python - tensorflow 代码TypeError : unsupported operand type(s) for *: 'int' and 'Flag'

标签 python tensorflow nlp seq2seq

I have give the mode,but it shows error,run it in tensorflow1.6 BATCH_QUEUE_MAX = 100

self._data_path = data_path
self._vocab = vocab
self._hps = hps
self._single_pass = single_pass

# Initialize a queue of Batches waiting to be used, and a queue of Examples waiting to be batched
self._batch_queue = Queue.Queue(self.BATCH_QUEUE_MAX)
self._example_queue = Queue.Queue(self.BATCH_QUEUE_MAX * self._hps.batch_size);

这段代码突然跑不了了,因为tensorflow变成1.6版本了?

enter image description here

最佳答案

这些标志的 API 发生了变化。基本上,您必须在每个实例之后编写 .value,例如 self._hps.batch_size.value

关于python - tensorflow 代码TypeError : unsupported operand type(s) for *: 'int' and 'Flag' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49312591/

相关文章:

PythonAnywhere->ImportError 引发加载 nrpccms.newsroom.templatetags.blog_extras : No module named settings

python - tf.divide() 和 tf.cast() 将中断我的程序的梯度传播。有什么办法可以解决这个问题吗?

python - spacy lemmatizer 如何工作?

python - 获取完整的unicode句子

python - 有人可以解释这个 log_normal_pdf 术语对 tensorflow VAE 演示代码的含义吗?

machine-learning - Google Cloud AutoML 中的身份验证问题

python - 在 C++ 中嵌入 Python 并使用 Boost.Python 从 C++ 代码调用方法

python - 优化两个 SQL 查询和一个列表理解

python - 加载word2vec时出现UnicodeDecodeError错误

python - 如何在 Python 中导入 tensorflow lite 解释器?