Error in attribute round
model.predict_on_batch(training_data['inputs']).round(1)- After running this line of code I'm getting this error
'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'round'
2 answers ( 0 marked as helpful)
Hi Mohib,
I believe this might be an issue for older versions of tensorflow and eager execution.
You could try:
import tensorflow as tf
tf.enable_eager_execution()
Just to make sure to restart your Kernel.
Otherwise you might want to upgade tensorflow with
pip install tensorflow --upgrade
Hope this helps!
Best,
EliHi !
If you are using python 3.7 and tensorflow 2.0 this is an alternate way to display the same
x=model.predict_on_batch(training_data['inputs'])You store it in an array and there you go! Hope this helped!
arr=np.array(x)
arr.round(1)