背景:在服务器上搭建anaconda环境,已下载好以下文件:

  • anaconda3.5.2.0-Linux-x86_64.sh
  • tensorflow_gpu-1.14.0-cp37-cp37m-manylinux1_x86_64.whl
  • Keras-2.2.4-py2.py3-none-any.whl
  • opencv_contrib_python-4.1.0.25-cp37-cp37m-manylinux1_x86_64.whl
1. 安装anaconda
  • 下载Anaconda最新.sh文件
    wget https://mirrors.tuna.tsinghua.edu.cn./anaconda/archive/anaconda3.5.2.0-Linux-x86_64.sh
  • ls命令查看
    (因为服务器上已有文件,所以前两步已省略)
  • bash Anaconda3.sh安装,一路enter、yes
  • 重启账户即可看到当前用户目录下已有anaconda文件夹
2.安装tensorflow和Keras
  • 新建虚拟环境:conda create -n myenv python=3.7
  • **环境:source activate myenv
  • conda list可查看当前已安装的包
  • pip install tensorflow_gpu-1.14.0-cp37-cp37m-manylinux1_x86_64.whl
    Anaconda3+tensorflowgpu+keras安装+jupyter连接
  • pip install Keras-2.2.4-py2.py3-none-any.whl
    Anaconda3+tensorflowgpu+keras安装+jupyter连接
  • pip install opencv_contrib_python-4.1.0.25-cp37-cp37m-manylinux1_x86_64.whl
    Anaconda3+tensorflowgpu+keras安装+jupyter连接
3. 安装jupyter
  • 退出**环境:source deactivate myenv
  • conda install jupyter
4. mac连接服务器jupyter
  • 打开terminal,输入ssh -N -L localhost...
  • 打开浏览器,输入,再输入登录服务器的当前用户的密码
    Anaconda3+tensorflowgpu+keras安装+jupyter连接