在jupyter notebook中 以下错误如何解决ModuleNotFoundError Traceback most recent call lastCell In10 line 4 2 import tensorflow as tf 3 import matplotlibpyplot as plt---- 4 from ten
这个错误可能是因为tensorflow版本更新导致的,新版本中已经将tensorflow.examples模块移除了。可以使用以下代码替换原来的导入方式:
from tensorflow.keras.datasets import mnist
# 加载MNIST数据集
(x_train, y_train), (x_test, y_test) = mnist.load_data()
这样就可以加载MNIST数据集了。
原文地址: https://www.cveoy.top/t/topic/ckSG 著作权归作者所有。请勿转载和采集!