tensorflow - TensorFlow 对象检测:model_main.py 和 train.py 都不再起作用
问题描述
火车.py
Traceback (most recent call last):
File "object_detection/legacy/train.py", line 48, in <module>
from tensorflow.contrib import framework as contrib_framework
ModuleNotFoundError: No module named 'tensorflow.contrib'
module_main.py
Traceback (most recent call last):
File "object_detection/model_main.py", line 26, in <module>
from object_detection import model_lib
File "/content/models/research/object_detection/model_lib.py", line 27, in <module>
from object_detection import eval_util
File "/content/models/research/object_detection/eval_util.py", line 40, in <module>
slim = tf.contrib.slim
AttributeError: module 'tensorflow' has no attribute 'contrib'
由于同样的错误,我什至无法将我的模型从检查点导出到推理图。
export_inference_graph.py
Traceback (most recent call last):
File "object_detection/export_inference_graph.py", line 108, in <module>
from object_detection import exporter
File "/content/models/research/object_detection/exporter.py", line 20, in <module>
from tensorflow.contrib.quantize.python import graph_matcher
ModuleNotFoundError: No module named 'tensorflow.contrib'
直到今天,所有三个文件都运行良好。培训使用 TF 1.15 和 2.1.0。我将 Colab 与 Python 3.6 和 GPU 训练一起使用。我最近在 tensorflow 的 github repo 中也找不到任何实质性的变化。
有什么想法吗?
解决方案
推荐阅读
- csv - 将 CSV 从 Neo4j 导出到 AWS S3 失败
- python - 如何跟进 Oauth Token
- hive - hive 计算从最早时间到当天所有数据的TOPN
- python - 在 Pandas 从长数据框到宽数据框时重命名列
- verilog - 是否可以在编译时在 verilog 中声明模块输入?
- .net - xunit 2.4.1 使用 cli dotnet test --collect:"Code Coverage" 不生成覆盖 xml
- visual-studio - 已移除的视觉对象显示在实时视觉对象树中
- html - 当我调整窗口大小时,我的页脚前出现了一个全新的空白区域,我不知道为什么
- python - 给定数组 [1, 5, 6, -11, 6, 2] 当加在一起等于 X 时返回对
- rust - Rust 中的 Bindgen 未定义引用