1、TensorFlow版本的问题

报错:RuntimeError: `get_session` is not available when using TensorFlow 2.0.

解决办法:这个问题是TensorFlow版本问题,在2.0以上get_session是被移除了。需要做一些修改,或者把tf降级。可以安装1.15版本:pip install tensorflow==1.15 –upgrade

参考链接:http://30daydo.com/article/561

2、python版本问题

报错:安装TensorFlow1.15.2时,Could not find a version that satisfies the requirement tensorflow

解决办法:TensorFlow版本不支持Python3.7,改为3.6即可

参考链接:https://blog.csdn.net/xavier_muse/article/details/83998744

3、keras版本问题,模型训练时出现问题

报错:AttributeError: module ‘keras.backend’ has no attribute ‘control_flow_ops’

解决办法:直接把keras卸载 pip uninstall keras,重新安装指定版本keras pip install keras==2.1.5

参考链接:https://www.lizenghai.com/archives/39235.html

4、Keras+yolo3训练自己的数据时 运行train.py

报错:TypeError: ‘NoneType’ object is not iterable

解决办法:需要生成好”Annotations“的xml文件后,再生成ImageSets/Main下的txt文件

参考链接:https://blog.csdn.net/helloworldsyf/article/details/104212485

 

未完待续~~~

 

总结:模型训练需要的环境,括号内是版本号,没指定版本的话可以不考虑(小版本号可以不考虑),按照安装顺序来

python(3.6),numpy,TensorFlow(1.15.2),Keras(2.1.5),pillow-PIL,matplotlib,opencv-python

版权声明:本文为songhuanzhao原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/songhuanzhao/p/12555573.html