我的代码有问题,我需要帮助来解决它。我有张量流版本2.12.0。
import tensorflow as tf
(train_image, train_labels), (test_image, test_labels) = tf.keras.datasets.mnist.load_data()
我有:
ImportError: cannot import name 'deserialize_keras_object' from partially initialized module 'keras.saving.legacy.serialization' (most likely due to a circular import) (/home/jude/anaconda3/envs/tf/lib/python3.11/site-packages/keras/saving/legacy/serialization.py)
这是什么以及如何解决这个问题?
pip 卸载张量流 pip 安装tensorflow==2.12.0
或
从tensorflow.keras.datasets导入mnist (train_image, train_labels), (test_image, test_labels) = mnist.load_data()