想從tensorflow中導入mnist手寫數字數據集,結果報錯
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()my_mnist = input_data.read_data_sets("MNIST_data_bak/", one_hot=True)"""
Traceback (most recent call last):File "G:/PyCharm/workspace/tensorflow/12_Softmax_regression.py", line 1, in <module>from tensorflow.examples.tutorials.mnist import input_data
ModuleNotFoundError: No module named 'tensorflow.examples'
"""
錯誤原因
在該環境位置下缺少example文件夾
若您在該位置下有example文件夾,另尋其他方法吧
解決方案
下載該文件夾examples免費的
放入到上圖指定位置處即可