[英]Tensorboard DuplicateFlagError
我正在为CNN修改张量板示例代码: https ://www.tensorflow.org/tutorials/deep_cnn#launching_and_training_the_model
我收到此错误:
DuplicateFlagError: The flag 'batch_sizes' is defined twice. First from D:/UofU/.../mycifar10.py, Second from D:/UofU/.../mycifar10.py. (Where both path names are the same) Description from first occurrence: Numbers of images to process in a batch.
这是必须产生错误的代码的关键:
tf.app.flags.DEFINE_integer('batch_size', 49,
"""Numbers of images to process in a batch.""")
看起来您正在某种程度上运行两次定义了batch_size
参数的代码块。 也许它在一个函数中,并且您多次调用它,或者以其他方式调用它。
可能的是,如果您是从jupyter Notebook运行它的,并且您正在重新运行单元格(也许在某些代码更改之后),则不会清除标志,而是尝试再次定义它。 在这种情况下,您必须在每次运行此单元格之前重新启动运行时,或者将这些标志分成各自的单元格,运行一次,然后运行并重新运行其余代码。
如果这些都不适用,则您必须发布代码(包括运行方式的说明)才能发表更多意见。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.