Numpy版本問題,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'”


tensorflow cpu版,成功安裝后

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(我的anaconda最新版本)版本的numpy

pip uninstall numpy

pip install numpy==1.16.4

默認鏡像出現下載安裝錯誤

 於是更換鏡像源再安裝

  pip install numpy==1.16.4 -i  https://pypi.tuna.tsinghua.edu.cn/simple/

輸入測試后不再報錯


免責聲明!

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



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