##首先根据官网给出的步骤
https://discuss.gluon.ai/t/topic/13576?u=bigbigwolf-ai
首先创建虚拟环境
conda create -n gluon python=3.6
激活
conda create -n gluon python=3.6
安装GPU版本的mxnet
conda install cudatoolkit=10.0
安装cuda,不用安装cudnn,自带
conda install cudatoolkit=10.0
安装对应版本的mxnet
pip install mxnet-cu100
安装压缩包中给的依赖环境
pip install d2lzh0.8.11
pip install jupyter1.0.0
pip install matplotlib2.2.2
pip install pandas0.23.4
安装过程中可能会出错,具体报错可以自行百度
https://zh.d2l.ai/d2l-zh-1.0.zip
这个是书中的代码的地址,包括所需要的依赖环境
注意这个解压的路径一定不要包含中文,否则jupyter会“一直连接内核”,而不报错,并且前面[ ]一直是 * 形式
接着到压缩包的解压地址输入
conda activate gluon
jupyter notebook
即启动jupyter
刚开始启动成功,但是引入mxnet时报错,
https://blog.csdn.net/m0_37723587/article/details/98664914
根据此博客,先安装:
conda install ipykernel conda install -n gluon ipykernel
将虚拟机写入notebook的kernel中
python -m ipykernel install --user --name 虚拟机 --display-name “Python (环境名称)”
如:
python -m ipykernel insatll --user --name gluon --display-name "gluon"
但是我这一步出错,无法启动jupyter
出现错误1:ImportError: cannot import name ‘generator_to_async_generator’
解决:
https://blog.csdn.net/d200746/article/details/103247290
pip uninstall -y ipython prompt_toolkit pip install ipython prompt_toolkit
接着报错2: ModuleNotFoundError: No module named 'IPython.core
https://blog.csdn.net/weixin_43064339/article/details/88594211
pip install ipython --ignore-installed ipython
又又又报错:
AttributeError: type object ‘IOLoop‘ has no attribute ‘initialized‘
大部分博客都说是因为tornado版本过高,
so:
https://blog.csdn.net/Joyyang_c/article/details/108486172
1.首先pip list 查看自己的tornado版本;
2.然后pip unistall tornado
3.pip list 再次确认是否卸载成功
4.强烈建议安装 pip install tornado==4.4.3 (4.5版本会报一个错:jupyterRuntimeError: No supported color terminal library)
5.关闭重新在端输入jupyter notebook 成功进入(如果安装4.4.3出现setuptools没有先下载这个就ok)



