The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Error in attribute round

Error in attribute round

0
Votes
2
Answer
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

365 Team
0
Votes

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, 
Eli

Hi Eli & team, i’m receiving the same error message at the same stage. I checked which version of tensorflow is being used and it’s 2.1.0. But the problem still persists. Running the code tf.enable_eager_execution() gives an error as expected.

6 months

0
Votes

Hi !
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’])
arr=np.array(x)
arr.round(1)

 
You store it in an array and there you go!
Hope this helped!