重新安装和使用的TensorFlow的时候,遇到了一些环境上的小问题:
1、tf.estimator package 未安装
tf.estimator package not installed
我使用的环境是:
anaconda 5.2.0, Python 3.6和TensorFlow 1.12
然后在网上找了一下解决方案之后,发现需要更新一下numpy、pandas和matplotlib等package:
pip install -U pandas
pip install -U matplotlib
将pandas的版本更新到了0.23.4,matplotlib更新到3.0.2就好了,然后import TensorFlow的时候就不会报错了
2、import tensorflow的提醒
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
这个问题还是环境问题,h5py出了问题,对h5py进行一个升级了就,后面再import tensorflow的时候,就不会出错了。
pip install h5py==2.8.0rc1
3、
TypeError: __init__() got an unexpected keyword argument 'serialized_options'
很有可能是,终端上的 protoc 版本 与python库内的protobuf版本不一样。
pip install -U protobuf
4、将Python程序不挂断的跑到服务器上面,
注意CUDA_VISIBLE_DEVICES=0需要放在nohup的前面。
CUDA_VISIBLE_DEVICES=0 nohup python -u main.py
参考资料:
1、https://github.com/tensorflow/tensorflow/issues/22342
2、https://blog.csdn.net/qq_41185868/article/details/80276847
网友评论