深度学习环境搭建 - 2 docker+deepo+jupyter

过年机器还有些没发货,先在笔记本上演练下装环境。

肯定是docker+deepo+jupyter+wing ide组合了。各种优点不说了,重点是不折腾+随时随地折腾。

win10 home + docker

docker for windows要求win pro以上。家庭版不支持hyper-v。docker-toolbox我是拒绝的,性能差啊!于是参照这篇文章,操作如下:
1,新建cmd脚本,开启hyper-v component:
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause

2,新建cmd脚本,开启hyper-v containers:
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del containers.txt
Dism /online /enable-feature /featurename:Containers -All /LimitAccess /ALL
pause

3,重启电脑

4,改注册表\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion :
EditionID键值改为 Professional

5,安装docker for windows(最新的好像不行),官网很慢我下载的这个里面的Docker Windows 18.06.1-ce-win73。

6,搞定。

deepo

著名的image,笔记本不支持cuda,所以我装的tag是:py36-jupyter-cpu。

启动命令:docker run -it -p 8888:8888 ufoym/deepo:py36-jupyter-cpu jupyter notebook --no-browser --ip=0.0.0.0 --allow-root --NotebookApp.token= --notebook-dir='/root'

浏览器链接http://localhost:8888搞定。

网页上新开terminal,安装jupyter插件:
pip install jupyter_contrib_nbextensions
pip install jupyter_nbextensions_configurator
jupyter contrib nbextension install --user
jupyter nbextension enable execute_time/ExecuteTime
pip install ipywidgets
pip install qgrid
pip install RISE
jupyter-nbextension install rise --py --sys-prefix
jupyter-nbextension enable rise --py --sys-prefix

重启jupyter,网页上多了个Nbextensions标签页,在这个页面里,启用各种插件

你可能感兴趣的:(深度学习环境搭建 - 2 docker+deepo+jupyter)