tensorflow eager execution changes at runtime

92 views Asked by At

I'm using with tensor2tensor (1.9.0) and tensorflow 1.9. When i try to enable eager execution tf.enable_eager_execution() in t2t-decoder it works just fine. However, when the program breaks inside the python code of tensor2tensor, i find that the eager execution has been disabled. tried to grep for anything that could be disabling it within t2t framework but i can't find anything that could potentially do that.

versions: t2t 1.9.0 tensorflow (cpu) 1.9.0 python 3.6 ubuntu 18.04

1

There are 1 answers

0
Golden Lion On

I am using python 3. I had to put tensorflow and tf.enable_eager_execution at the top of my script

 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())   

output:

 [5,6]