1.查看cuda版本(无关)
wlsh@wlsh-thinkstation-p920:~$ nvcc -V wlsh@wlsh-thinkstation-p920:~$ cat /usr/local/cuda/version.txt |
2.安装anaconda虚拟环境
wlsh@wlsh-thinkstation-p920:~$ conda create -n py3_torch python=3.6 |
3.安装opencv
(py3_torch) wlsh@wlsh-thinkstation-p920:~$ conda install opencv |
4.安装pytorch和torchvision
(py3_torch) wlsh@wlsh-thinkstation-p920:~$ conda install pytorch torchvision cudatoolkit=10.0 -c pytorch |
5.安装tensorflow和tensorboardX
https://www.zhihu.com/people/arsliv/posts
(py3_torch) wlsh@wlsh-thinkstation-p920:~$ conda install tensorflow-gpu |
6.jupyter notebook关联此虚拟环境
(py3_torch) wlsh@wlsh-thinkstation-p920:~$ conda install nb_conda |
7.端口重定向
本地mac连接远程服务器jupter notebook方法
[wlsh@wlsh-MacbookPro] ~$ ssh -L 8000:localhost:8888 wlsh@10.19.127.168 |
本地mac连接远程服务器可视化tensorboardX
参考:https://blog.csdn.net/weixin_35653315/article/details/71327740
#连接ssh时,将远程服务器的6006端口重定向到Mac上 |
8.本地pycharm使用远程服务器的python解释器,并编辑服务器的代码
Configure a remote interpterter using SSH : https://www.jetbrains.com/help/pycharm/configuring-remote-interpreters-via-ssh.html
Pycharm - > Preferences
Creating a Remote Server Configuration: https://www.jetbrains.com/help/pycharm/creating-a-remote-server-configuration.html
Tools - > Deployment
9.解决加载外面的py文件不成功方法:
https://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython
%load_ext autoreload |
10.cell输出多行
from IPython.core.interactiveshell import InteractiveShell |