Saving a Tensorflow variable as ".npy" with eager execution disabled

I want to save a tensorflow variable of type tensorflow.python.framework.ops.Tensor as a .npy file while eager execution is disabled. Now this works absolutely fine with eager execution enabled if I simply do tfvar.numpy() and then save it as .npy but it doesn’t work with if eager execution is disabled.

Is there any way to do this ? I do not want eager execution enabled. I am using tensorflow 1.15.2 and numpy 1.19.5

Source: Python Questions

LEAVE A COMMENT