[英]Tensorflow Object Detection API - Error running model_builder_test.py module 'tensorflow' has no attribute 'contrib'
I installed the Tensorflow Object Detection API, and ran the model_builder_test.py script to make sure everything was working.我安装了 Tensorflow Object 检测 API,并运行 model_builder_test.py 脚本以确保一切正常。 I got the following error:
我收到以下错误:
AttributeError: module 'tensorflow' has no attribute 'contrib'
I'm using Python 3.7.3 and Tensorflow 2.0.0.我正在使用 Python 3.7.3 和 Tensorflow 2.0.0。 According to this answer , it may be related to Tensorflow version 2. I'm going to use this method to upgrade the model_builder_test.py script.
根据this answer ,可能与Tensorflow第2版有关。我打算用这种方法升级model_builder_test.py脚本。 However, I'm worried about other issues in the Object Detection API using Tensorflow 2.
但是,我担心 Object 检测 API 使用 Tensorflow 2 中的其他问题。
My questions are:我的问题是:
1) Am I correct in interpreting this error? 1)我在解释这个错误时是否正确?
2) Is it safe to use Object Detection with Tensorflow 2, or should I downgrade to Tensorflow 1.x? 2) 使用 Object 检测和 Tensorflow 2 是否安全,或者我应该降级到 Tensorflow 1.x?
Thanks!谢谢!
1) Yes 1) 是的
2) Yes, and it may in fact work better per several bug fixes in TF2 - but make sure you follow the linked guide closely to confirm model behavior doesn't change unexpectedly (ie compare execution in TF1 vs. TF2) 2) 是的,事实上它可能会在 TF2 中的几个错误修复中更好地工作 - 但请确保您密切关注链接指南以确认 model 行为不会意外改变(即比较 TF1 与 TF2 中的执行)
However ;然而; the "make sure" in (2) is easier said than done - we're talking about an entire API here.
(2) 中的“确保”说起来容易做起来难——我们在这里谈论的是整个 API。 This is best left to the API's devs themselves, unless you're highly familiar with relevant parts of the repository .
这最好留给 API 的开发人员自己,除非您非常熟悉存储库的相关部分。 Even if you fix one bug, there may be others, even those that don't throw errors, per class/method-based functionality changes (especially in Eager vs. Graph interactions).
即使您修复了一个错误,也可能存在其他错误,甚至是那些不会引发错误的错误,每个基于类/方法的功能更改(尤其是在 Eager 与 Graph 交互中)。 There's not much harm to using TF 1.x, and it may even run faster .
使用 TF 1.x 并没有太大的危害,它甚至可能运行得更快。
Lastly, I'd suggest opening a TF Git issue on this;最后,我建议就此打开一个 TF Git 问题; contributors/devs may respond there & not here.
贡献者/开发者可能会在那里而不是在这里做出回应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.