read_data_sets is not defined 解決方案

引入套件更改:
import tensorflow.compat.v1 as tf
from tensorflow.examples.tutorials.mnist import input_data
關閉eager模式(放在引入行最底下即可):
tf.compat.v1.disable_eager_execution()

函數變更:
原方法 self.data = read_data_sets(path, one_hot=True)
變更為 self.data = input_data.read_data_sets(path, one_hot=True)

Commentaires