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 |