Search code examples
tensorflowgoogle-colaboratory

Colab No module named 'tensorflow.examples.tutorials'


I'm a beginner in this field Using Colab, I have a problem there aren't tensorflow.examples.tutorials I have checked something is existed or not there is only one thing called examples.saved_model

if you know how to download or connect with Colab

Please give me a solution

ModuleNotFoundError:Traceback (most recent call last)
<ipython-input-13-da20ef9adb09> in <module>()
----> 1 from tensorflow.examples.tutorials import mnist

ModuleNotFoundError: No module named 'tensorflow.examples.tutorials'

Any suggestions would be appreciated.


Solution

  • ModuleNotFoundError: No module named 'tensorflow.examples.tutorials'
    

    tensorflow.examples.tutorials is now deprecated, hence you received this error.

    It is recommended to use tensorflow.keras.datasets, please refer below code

    import tensorflow as tf
    (train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.mnist.load_data()
    

    For more details please refer this