anaconda中安装tensorflow1.15以及Jupyter

anaconda中安装tensorflow1.15以及Jupyter

  • 1.安装TensorFlow1.15
            • tensorflow1.15+cuda10.0+cudnn7.4
            • PackagesNotFoundError: The following packages are not available from current channels
            • conda install tensorflow-gpu==1.15
  • 2.安装jupyter
            • pip install jupyter
            • ERROR: Cannot uninstall 'pyzmq'. It is a distutils installed project
            • jupyter notebook
            • type object 'IOLoop' has no attribute 'initialized'
            • conda install tornado=4.5
  • 3.将虚拟环境添加到 Jupyter
            • conda activate 你的环境名
            • pip install --user ipykernel
            • python -m ipykernel install --user --name=你的环境名
            • ImportError: cannot import name 'generator_to_async_generator'
            • pip3 install prompt-toolkit==1.0.15
            • python -m ipykernel install --user --name=你的环境名
            • pip3 install --upgrade prompt-toolkit
            • pip uninstall -y ipython prompt_toolkit
            • pip install ipython prompt_toolkit
            • pip install ipython --ignore-installed ipython
            • python -m ipykernel install --user --name=你的环境名
  • 注意事项

1.安装TensorFlow1.15

github上下载的代码好多都是用的tensorflow1.X版本,里面有个contrib库在tensorflow2.X版本中被弃用了,虽然可以升级代码,但是需要你对代码有很深的理解,才能写得出来新的啊(手动哭5555~~)。没办法只能降tensorflow版本到1.15。
下载tensorflow1.15的过程也很艰巨,官网给出的版本对应是:

tensorflow1.15+cuda10.0+cudnn7.4

网上讲的好多方法都找不到cudnn7.4的下载源,导致无法安装,会报这个错误:

PackagesNotFoundError: The following packages are not available from current channels

最后我发现不应该用cudnn7.4,应该用cudnn7.6。用这句话就行了:

conda install tensorflow-gpu==1.15

tensorflow1.15+cuda10.0+cudnn7.6全套给你下完。

2.安装jupyter

我一开始先在anaconda的图形界面里,直接安装了jupyter,就这个地方。

anaconda中安装tensorflow1.15以及Jupyter_第1张图片

然后再在anaconda prompt里用:

pip install jupyter

问题又出现了:

ERROR: Cannot uninstall ‘pyzmq’. It is a distutils installed project

网上提供的解决办法是找到文件夹删各种文件,千万别被带着走。一步操作就可以了——把你刚才在上图中界面里装的jupyter给他remove掉。

你可能感兴趣的:(python,tensorflow,深度学习)