pycharm+keras+yolo3的使用和自選模型的訓練中遇到的坑


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


免責聲明!

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



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