0.各个镜像源
https://pypi.douban.com/simple/ 豆瓣
https://mirrors.aliyun.com/pypi/simple/ 阿里
https://pypi.hustunique.com/simple/ 华中理工大学
https://pypi.sdutlinux.org/simple/ 山东理工大学
https://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学
https://pypi.tuna.tsinghua.edu.cn/simple 清华
-------------------------------------------------------------
下载model
https://gitee.com/xuanlangzhiyin0921/models_tensorflow2.x
------------------------------------------------------------
编译protobuf
#############################################
protoc object_detection/protos/*.proto --python_out=.
##############################################
--------------------------------------------------------------
conda env list
1.创建python环境
conda create -n tf20 python=3.6
2.激活环境
conda activate tf20
3.
pip install tensorflow==2.4.0 -i https://pypi.douban.com/simple
-----------------------------------------
tensorflow玉numpy版本匹配
pip uninstall numpy
pip install numpy==1.16.4 -i https://pypi.douban.com/simple
-----------------------------------------
4.测试tensorflow是否按照成功
---------------------------------
下面是tensorflow2.0版本测试
import tensorflow as tf
tf.compat.v1.disable_eager_execution() # 保证sess.run()能够正常运行
hello = tf.constant('hello,tensorflow')
sess= tf.compat.v1.Session() # 版本2.0的函数
print(sess.run(hello))
————————————————
下面是tensorflow1.0版本测试
import tensorflow as tf
sess = tf.Session()
hello = tf.constant('hello, tensorflow!')
print(sess.run(hello))
----------------------------------
5.在D:\tensorflow\models\research下执行
-------------------------------
python setup.py install
需要等一段时间
-------------------------------
6.测试tensorflow object detection api是否安装成功
-----------------------------------------------------------------
python object_detection/builders/model_builder_test.py
------------------------------------------------------------------
问题:当发现ModuleNotFoundError: No module named 'nets',我告诉你怎么办
在*/research/slim下运行命令
-------------------------------
python setup.py build
python setup.py install
-------------------------------
ModuleNotFoundError: No module named 'matplotlib'
pip install matplotlib -i https://pypi.douban.com/simple
pip install requests -i https://pypi.douban.com/simple
pip install jupyter -i https://pypi.douban.com/simple
--------------------------------------------------------------------------------------------------------
C:\Users\admin\Anaconda3\envs\tf14\lib\site-packages\ipykernel_launcher.py:22: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
运行第二次
问题:
D:/tensorflow/models/research/object_detection/object_detection_example_2.py:115: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
解决方案:
-------------------------------------------------------------
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
-------------------------------------
Tensorflow Object detection API 在 Windows10 配置
https://blog.csdn.net/sinat_28371057/article/details/113692022
-------------------------------------------------------------------
ModuleNotFoundError: No module named 'object_detection'
解决方案:
新建tensorflow_model.pth文件
放入...\Lib\site-packages包里面
-------------------------------------------------------------------
问题:
File "D:\tensorflow20\models-master\research\object_detection\utils\ops.py", line 28, in <module>
import tf_slim as slim
ModuleNotFoundError: No module named 'tf_slim'
解决方案:
pip install tf_slim -i https://pypi.douban.com/simple
--------------------------------------------------------------------
问题:ModuleNotFoundError: No module named 'scipy'
解决方案:pip install scipy -i https://pypi.douban.com/simple
---------------------------------------------------------------------
问题:ModuleNotFoundError: No module named 'tensorflow_io'
解决方案:pip install tensorflow_io -i https://pypi.douban.com/simple
--------------------------------------------------------------
问题:ModuleNotFoundError: No module named 'matplotlib'
解决方案:pip install matplotlib -i https://pypi.douban.com/simple
------------------------------------------------------------------------------
问题:ModuleNotFoundError: No module named 'official'
解决方案:pip install tf-models-official -i https://pypi.douban.com/simple
参考资料
https://blog.csdn.net/fendouaini/article/details/107698636
----------------------------------------------------------------------------------------
问题 AttributeError: 'AutoTrackable' object has no attribute 'output_shapes'
参考资料:[实习2021-03-30]Object_detection_tutorial踩坑记录_TBooMAYZ的博客-CSDN博客