PracticalDL / Practical-Deep-Learning-Book

Official code repo for the O'Reilly Book - Practical Deep Learning for Cloud, Mobile & Edge
http://practicaldeeplearning.ai
MIT License
743 stars 310 forks source link

Chapter 2: OperatorNotAllowedInGraphError in colabs #61

Closed mgijsberti closed 4 years ago

mgijsberti commented 4 years ago

Hi,

This happened when running the 2-colab-what-does-my-neural-network-think.ipynb notebook in colabs.

When tensorflow 2.0 is installed in step 2 (!pip install tensorflow==2.0.0), it seems like you have to restart the runtime and run the code again. That is not entirely clear in the notebook but you can see a notice at the end of the installation.

If you do not restart, the process_image give and errorOperatorNotAllowedInGraphError(See https://stackoverflow.com/questions/57888872/how-to-fix-operatornotallowedingrapherror-error-in-tensorflow-2-0).

Not sure but maybe the code or instructions need an update to make this work from scratch. Hope this helps.

Seems like there is an issue reported in tensorflow 2.0, see https://github.com/tensorflow/tensorflow/issues/32546.

The issue mentions also a gist which reproduces the exact same error, see https://colab.research.google.com/gist/oanush/0983d6584c1c687c0456fff142db4ad4/32546.ipynb

sidgan commented 4 years ago

Thank you for the suggestion! Added note via https://github.com/PracticalDL/Practical-Deep-Learning-Book/pull/63.