简体   繁体   English

TensorFlow 在 Colab 中运行但不在本地计算机上运行

[英]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.我刚开始学习 TensorFlow 课程,它的所有实验室都在 Google Colab 中,效果非常好。 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:然而,我也想记录下我在电脑上所做的事情,但它显示了一个“几页长”的错误,最后一行在我运行tensorFlow 命令如:

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.我成功 pip 安装了 TensorFlow 并在文件开头将其导入为 tf。 Can anybody tell me what am I not doing, please?谁能告诉我我没有做什么?

Try loading the dataset using keras尝试使用 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.按照 Leon 所说检查版本,然后告诉我们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 google colab 使用本地运行时并且不检测本地 gpu - google colab using local runtime and doesn't detect local gpu Tensorflow 在家用 PC 上的 GPU 上运行,但不在 Google colab 上运行 - Tensorflow Runs on GPU on home PC but not on Google colab 将数据从 google colab 导出到本地机器 - Exporting Data from google colab to local machine Google colab 在使用 python 和 tensorflow 进行图像分类时不显示错误、图表和任何图像结果? - Google colab doesn't display errors, graphs, any image results while working with python and tensorflow for Image classification? 无法访问目录 Tensorflow Google Colab - Can't access directory Tensorflow Google Colab 我无法在 google colab 上导入 Tensorflow - I can't import Tensorflow on google colab Python genfromtxt 无法将文件从本地机器导入到 google colab - Python genfromtxt cannot import file from local machine to google colab 列表索引超出范围.. 适用于 google colab 但不适用于本地机器? - List Index out of range.. works on google colab but not on local machine? TensorFlow 相同的 Model 在 Colab 和本地返回不同的结果 - TensorFlow Same Model returning different results in Colab and local Tensorflow 在本地 GPU 上比 LSTM 上的 Colab GPU 慢 - Tensorflow slower on Local GPU than Colab GPU on LSTM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM