简体   繁体   中英

TensorFlow that runs in Colab but doesn't on local machine

I just started the TensorFlow course and all its labs are in Google Colab, which works perfect. However, I would also like to keep the notes of what I do on my computer, but it shows me a 'couple pages long' error, last line saying "TypeError: 'NoneType' object is not iterable" as soon as I run a tensorFlow command such as:

model = tf.keras.Sequential([l0])

OR:

dataset, metadata = tfds.load('fashion_mnist', as_supervised=True, with_info=True)

I successfully pip installed TensorFlow and import it as tf at the beginning of the file. Can anybody tell me what am I not doing, please?

Try loading the dataset using keras

from keras.datasets import fashion_mnist
(X_train, y_train), (X_test, y_test) = fashion_mnist.load_data()

And this for the first part

from keras.models import Sequential
model = Sequential()
model.add(...)

Check the version as Leon said, and tell us.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM