本文介绍了AttributeError: 模块“tensorflow"没有属性“app"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在关注本教程并在做一个使用 tensorflow 进行自定义对象检测的项目.
I am following this tutorial and doing a project on custom object-detection using tensorflow.
因此,当我尝试使用以下命令为火车图像创建 TF 记录时
So when I tried to create TF record for the train images using the following command
python3 generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=data/train.record
我收到以下错误:
Traceback (most recent call last):
File "generate_tfrecord.py", line 23, in <module>
flags = tf.app.flags
AttributeError: module 'tensorflow' has no attribute 'app'
我该如何解决这个错误?
How can I resolve this error?
推荐答案
try using import tensorflow.compat.v1 as tf
这篇关于AttributeError: 模块“tensorflow"没有属性“app"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!