I want to visualize Keras model using Google Colab environment. I found this link. However, I get an error if I copy-paste the code from this link to the Colab notebook:
from IPython.display import SVG
from keras.utils import model_to_dot
SVG(model_to_dot(model).create(prog='dot', format='svg'))
Error:
ImportError Traceback (most recent call last)
<ipython-input-9-819c3bda4aa6> in <module>()
1 from IPython.display import SVG
----> 2 from keras.utils import model_to_dot
3
4 SVG(model_to_dot(model).create(prog='dot', format='svg'))
ImportError: cannot import name 'model_to_dot'
model_to_dot can be imported if you change line 2 with:
from keras.utils.vis_utils import model_to_dot
model_to_dot can be imported if you change line 2 with:
from tensorflow.keras.utils import model_to_dot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With