我有一个读取验证码的源代码。当我运行测试时,我在 Windows 10 上遇到问题
Traceback (most recent call last):
File "train.py", line 48, in <module>
from object_detection.builders import dataset_builder
File "C:\Users\HuyHys\Anaconda3\lib\site-packages\object_detection\builders\dataset_builder.py", line 27, in <module>
from object_detection.data_decoders import tf_example_decoder
File "C:\Users\HuyHys\Anaconda3\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py", line 27, in <module>
slim_example_decoder = tf.contrib.slim.tfexample_decoder
AttributeError: module 'tensorflow' has no attribute 'contrib'
我在 stackoverflow 上发现了一个问题(访问 Module 'tensorflow' has no attribute 'contrib' )
但我无法修复这个错误。请任何人都可以帮助我! 如何修复此错误的详细信息???
最佳答案
出现此错误的原因是 tf.contrib
已从 TensorFlow 2 中删除。我猜您正在使用 Tensorflow 1 中的旧代码,该代码与新的 Tenserflow 2 不兼容。有关更多信息,请查看 Migrate your TensorFlow 1 code to TensorFlow 2 。如果您需要更多帮助,请分享您使用 tf.contrib
的所有代码片段。
关于python-3.x - 如何修复Windows上的错误:"AttributeError: module 'tensorflow'没有属性 'contrib',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58601627/