NotePublic/Software/Applications/Tensorflow/Docker_TensorFlow_Jupyter_环...

49 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

# Docker+TensorFlow+Jupyter 环境搭建
## 1.安装和配置
```bash
# Tensorflow1
docker run -t -p 1008:8888 -e JUPYTER_ENABLE_LAB=yes --name=tensorflow --privileged -v <host dir>:/home/jovyan jupyter/tensorflow-notebook:17aba6048f44
# Tensorflow2(ubuntu-18.04)
docker run -t -p 1008:8888 -e JUPYTER_ENABLE_LAB=yes --name=tensorflow --privileged -v <host dir>:/home/jovyan jupyter/tensorflow-notebook:ubuntu-18.04
```
之后通过浏览器访问对应 IP:Port 即可。
## 2.使能 Jupyter Lab 插件
settings->Advanced Settings Editor->Extension Manager
在 User Overrides 中进行修改
```json
{
"enabled": true
}
```
然后 Save User Settings刷新网页。侧边栏会显示“插件选项”在其中可进行搜索、安装和卸载等插件管理操作。
## 3.Jupyter Notebook 配置
```bash
docker exec -it <container name/id> pip install jupyter_contrib_nbextensions
docker exec -it <container name/id> jupyter contrib nbextension install --user --skip-running-check
# 重启容器
docker stop <container name/id>
docker start -a <container name/id>
```
访问 Jupyter Notebook->Nbextensions勾选
1. Highlight selected word
2. highlighter
3. jupyter-js-widgets/extension
4. Table of Contents
5. contrib_nbextensions_help_item
6. Hinterland
7. jupyter-matplotlib/extension
8. Nbextensions dashboard tab
9. Nbextensions edit menu item