解决:AttributeError: module ‘tensorflow.python.framework.ops‘ has no attribute ‘RegisterShape‘
2020-08-01 09:28
176 查看
tensorflow 2版本读取MNIST数据集,使用 read_data_sets,在导入时报错
from tensorflow.examples.tutorials.mnist import input_data
AttributeError: module 'tensorflow.python.framework.ops' has no attribute 'RegisterShape'
查网上说法是tf2版本已经弃用了
read_data_sets,但我这个报错原因不知道是不是因为这个,总之在导入时就出错
解决:换如下加载MNIST方法:
import tensorflow as tf mnist = tf.keras.datasets.mnist (X_train, y_train), (X_test, y_test) = mnist.load_data()
相关文章推荐
- AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'leaky_relu'
- AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'seq2seq'
- TensorFlow2.0 出现 AttributeError: module tensorflow has no attribute python_io
- Tensorflow protobuf版本报错问题解决(AttributeError: 'module' object has no attribute 'Default')
- 解决AttributeError: module 'tensorflow.python.training.checkpointable' has no attribute 'Checkpointabl
- module 'tensorflow.python.ops.nn' has no attribute 'seq2seq' ‘rnn_cell’
- AttributeError: module 'tensorflow.python.platform.flags' has no attribute 'mark_flag_as_required'
- AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'legacy_seq2s eq'
- 成功解决AttributeError: module 'tensorflow.python.training.training' has no attribute 'SummaryWriter'
- No module named 'tensorflow.python.tools',AttributeError: 'module' object has no attribute 'copy'
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- 成功解决AttributeError: module tensorflow has no attribute random_normal
- 【Python】Windows系统安装uWSGI报错AttributeError: module 'os' has no attribute 'uname'解决办法
- 解决Python报错: AttributeError: 'module' object has no attribute '_base'
- 成功解决AttributeError: module tensorflow has no attribute reset_default_graph
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python问题 : AttributeError: 'module' object has no attribute 'SSL_ST_INIT' 解决办法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法