【发布时间】:2019-10-02 02:49:26
【问题描述】:
我正在运行 Python 3.6.8 并使用以下软件包在虚拟环境中工作:
absl-py==0.8.0
astor==0.8.0
Click==7.0
cloudpickle==1.2.2
cycler==0.10.0
dask==2.5.0
dask-glm==0.2.0
dask-ml==1.0.0
distributed==2.5.1
fsspec==0.5.1
gast==0.3.2
google-pasta==0.1.7
grpcio==1.24.0
h5py==2.10.0
HeapDict==1.0.1
joblib==0.13.2
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
llvmlite==0.29.0
Markdown==3.1.1
matplotlib==3.1.1
msgpack==0.6.2
multipledispatch==0.6.0
numba==0.45.1
numpy==1.14.5
packaging==19.2
pandas==0.25.1
Pillow==6.1.0
protobuf==3.9.2
psutil==5.6.3
pyparsing==2.4.2
python-dateutil==2.8.0
pytz==2019.2
PyYAML==5.1.2
scikit-learn==0.21.3
scipy==1.3.1
seaborn==0.9.0
six==1.12.0
sortedcontainers==2.1.0
tblib==1.4.0
tensorboard==1.14.0
tensorflow==1.14.0
tensorflow-estimator==1.14.0
termcolor==1.1.0
toolz==0.10.0
tornado==6.0.3
Werkzeug==0.16.0
wrapt==1.11.2
zict==1.0.0
我正在关注这个 tensorflow 指南:https://www.tensorflow.org/tutorials/keras/classification
我正在加载 MNIST-Fashion 数据集。数据是一个向量,其值范围为 0 到 255。当我尝试在 0 和 1 之间缩放值时(底部的代码),我收到以下错误:
ValueError: 输出数组是只读的
当我尝试将 WRITTABLE 标志设置为 true 时,我收到以下错误:
ValueError: 无法将此数组的 WRITEABLE 标志设置为 True
fashion_mnist = keras.datasets.fashion_mnist
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
train_images /= 255.0
test_images /= 255.0
附加信息: 我试图将 numpy 降级到 1.14.5 和 1.15.4 并且错误仍然存在。此外,tensorflow 1.14.0 需要 numpy 1.14.5 或更高版本。
【问题讨论】:
标签: python