tensorflow2.0安裝


版本:

python3.5

Anaconda 4.2.0

tensorflow2.0 cpu版本

1、安裝命令

pip3 install tensorflow==2.0.0.0a0 -i  https://pypi.tuna.tsinghua.edu.cn/simple/ # -i表示重新指定鏡像,提高下載速度

2、報錯以及解決方法

(1)報錯: “Cannot remove entries from nonexistent file c:\program files\anaconda3\lib\site-packages\easy-install.pth”

  解決方案:

pip install --upgrade --ignore-installed setuptools

(2)報錯:“Cannot uninstall 'Werkzeug'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall”、、

  解決方案:

pip3 install  --ignore-installed Werkzeug tensorflow==2.0.0.0a0 -i  https://pypi.tuna.tsinghua.edu.cn/simple/

3、成功安裝后 import tensorflow as tf 報警:“ FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'”

  原因:numpy 的版本過低或者過高都會出現警告

  解決方案:  

# 需要先卸載現有的numpy,並重新指定1.16.4版本的numpy
pip3 uninstall numpy
pip3 install numpy==1.16.4 -i  https://pypi.tuna.tsinghua.edu.cn/simple/
# 如果還有部分報警,最后絕招
pip install h5py==2.8.0rc1


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM