導入TensorFlow報錯


C:\....\Anaconda3\envs\py35\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters

使用Anaconda安裝的Python3.5環境,導入TensorFlow時出現如下錯誤:

<<<import tensorflow as tf
C:\。..\Anaconda3\envs\py35\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

解決辦法:安裝Microsoft Visual C++ 2015 Redistributable Update 3 。不再報錯。

 --------------------------------------------分--------------------------------------------割--------------------------------------------線--------------------------------------

啊這個不是導入失敗,應該是字符格式。輸出字符的時候,會在行前有一個b,比如b'Hello TensorFlow!'

在打印行加上.decode()就可以解決了,如下:

print(sess.run(hello).decode())
Hello TensorFlow! 

 


免責聲明!

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



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