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 faced while extracting outputs

Error faced while extracting outputs

0
Votes
1
Answer

model.predict_on_batch(training_data[‘inputs’]).round(1)
gives error

AttributeError: 'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'round'

I have tried restarting the kernel and also updated TensorFlow to v2.1.0. I also have tried adding eager execution.

But,as the method is automatic in TF2,it throws up another error.

1 Answer

365 Team
0
Votes

Hi Manav,
Thanks for reaching out to us.
In order to use round on tensors of TensorFlow 2.1, we need to get their numpy arrays:
model.predict_on_batch(training_data['inputs']).numpy().round(1)
Best,
The 365 Team