为什么numpy数组不可写?
来源:4-5 利用神经网络解决分类和回归问题(3)

KingCoder
2021-08-07
train_data = dataset.MNIST(root=“mnist”,
train=True,
transform=transforms.ToTensor(),
download=True)
D:\anaconda3\envs\AI\python.exe E:/PycharmProjects/handwrittenNumeralRecognition/demo_cls.py
D:\anaconda3\envs\AI\lib\site-packages\torchvision\datasets\mnist.py:498: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at …\torch\csrc\utils\tensor_numpy.cpp:180.)
return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)
数据集下载完了,提示numpy不可写,MNIST文件夹只有row,为什么?
就是刚开始加载数据的时候报错
1回答
-
会写代码的好厨师
2021-08-09
代码截图,多截取一些。
032021-08-09
相似问题