Windows10 安装Tensorflow2.3.0-cpu 踩坑记
1. anaconda
https://repo.anaconda.com/archive/Anaconda3-2020.07-Windows-x86_64.exe
安装完成后,在开始菜单处打开Anaconda Prompt,开始安装Tensorflow
pip install tensorflow-cpu
安装完测试一下
>>> import tensorflow Traceback (most recent call last): File "C:\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module> from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模块。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module> from tensorflow.python.tools import module_util as _module_util File "C:\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module> from tensorflow.python.eager import context File "C:\anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module> from tensorflow.python import pywrap_tfe File "C:\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module> from tensorflow.python import pywrap_tensorflow File "C:\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module> from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模块。 Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.
解决办法:下载并安装vc_redist.x64.exe,之后重启电脑,再次import就会成功了,
下载vc_redist.x64.exe地址:https://support.microsoft.com/zh-cn/help/2977003/the-latest-supported-visual-c-downloads。
https://download.visualstudio.microsoft.com/download/pr/fd5d2eea-32b8-4814-b55e-28c83dd72d9c/952A0C6CB4A3DD14C3666EF05BB1982C5FF7F87B7103C2BA896354F00651E358/VC_redist.x64.exe
Jupyter Notebook
的使用。直接搜索 Jupyter 然后点开
然后访问127.0.0.1:8888
需要设置一个密码。token 在第一次启动的时候会显示出来。 然后设置一下密码即可了