【发布时间】:2021-03-19 15:02:41
【问题描述】:
我尝试运行https://github.com/4Catalyzer/cyclegan.git 我有类似的错误
AttributeError: 模块 'tensorflow._api.v2.train' 没有属性 'string_input_producer'
我使用 python 3.8.5 和 tensorflow 2.4.1
【问题讨论】:
标签: python-3.x tensorflow
我尝试运行https://github.com/4Catalyzer/cyclegan.git 我有类似的错误
AttributeError: 模块 'tensorflow._api.v2.train' 没有属性 'string_input_producer'
我使用 python 3.8.5 和 tensorflow 2.4.1
【问题讨论】:
标签: python-3.x tensorflow
tf.compat.v1.train.string_input_producer 已被弃用。它将在未来的版本中删除。更新说明:基于队列的输入管道已替换为tf.data。
使用tf.data.Dataset.from_tensor_slices(string_tensor)。
shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs)。如果 shuffle=False,则省略 .shuffle(...)
【讨论】: