我正在使用tensor2tensor (1.9.0)和tensorflow 1.9。当我尝试在T2T- tf.enable_eager_execution()解码器中启用急切执行解码器时,它工作得很好。但是,当程序在tensor2tensor的python代码内部中断时,我发现急切执行已被禁用。我试图在t2t框架中对任何可能禁用它的东西进行grep,但我找不到任何可能会这样做的东西。
版本: t2t 1.9.0 tensorflow (cpu) 1.9.0 python 3.6 ubuntu 18.04
发布于 2021-03-06 00:24:21
我使用的是Python3,我不得不把tensorflow和tf.enable_eager_execution放在我的脚本的顶部
import tensorflow as tf
tf.enable_eager_execution()
you may have to shutdown the kernal and jupyter notes than reopen them.
a=tf.Variable([1,2])
a.assign([5, 6])
print(a.numpy()) 输出:
[5,6]https://stackoverflow.com/questions/66122844
复制相似问题