服务器之jupyter notebook
前言
在服务器上跑深度学习才是真的爽。
一、安装jupyter notebook
首先,在服务器上安装jupyter notebook
命令:
pip install jupyter
二、生成jupyter notebook配置文件
接下来为了生成jupyter notebook配置文件,实现远程使用jupyter notebook
接着输入:
jupyter notebook --generate-config
三、设置jupyter密码
为jupyter设置密码:
jupyter notebook password
输入密码:
确认密码:
四、编辑jupyter notebook配置文件
编辑jupyter_notebook_config.py
vim ./.jupyter/jupyter_notebook_config.py
输入/p.ip+Enter
把c.NotebookApp.ip 改成*(输入i进入编辑状态)
输入/open_browser
把True改为Flase
按Esc + :wq退出编辑
五、输入 jupyter notebook
找到端口号8888,接着输入服务器的ip+:8888就能实现本机jupyter。
如果从外网的访问服务器的话,则需要进行端口映射。
在服务器连接的路由器设置xxxx映射到端口8888上。
这样在外网访问服务器时,输入路由器ip+:xxxx,路由器就会转发到端口8888连接到服务器
总结
就这样啦