download设置的是true,但是还报错呢
来源:6-7 代码训练过程

风雨_83
2020-04-15
Traceback (most recent call last):
File "/Users/wangyun/Documents/PythonStudy/111NLP/ChatBoot/cnn.py", line 65, in <module>
train_set = mnist.MNIST('./data',train=True)
File "/Users/wangyun/Documents/PythonStudy/111NLP/venv/lib/python3.7/site-packages/torchvision/datasets/mnist.py", line 73, in __init__
raise RuntimeError('Dataset not found.' +
RuntimeError: Dataset not found. You can use download=True to download it
2回答
-
风雨_83
提问者
2020-04-16
/Users/wangyun/Documents/PythonStudy/111NLP/venv/bin/python3.7 /Users/wangyun/Documents/PythonStudy/111NLP/ChatBoot/cnn.py
Traceback (most recent call last):
File "/Users/wangyun/Documents/PythonStudy/111NLP/ChatBoot/cnn.py", line 95, in <module>
for img,label in train_data:
File "/Users/wangyun/Documents/PythonStudy/111NLP/venv/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 345, in __next__
data = self._next_data()
File "/Users/wangyun/Documents/PythonStudy/111NLP/venv/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/Users/wangyun/Documents/PythonStudy/111NLP/venv/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/Users/wangyun/Documents/PythonStudy/111NLP/venv/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/Users/wangyun/Documents/PythonStudy/111NLP/venv/lib/python3.7/site-packages/torchvision/datasets/mnist.py", line 97, in __getitem__
img = self.transform(img)
File "/Users/wangyun/Documents/PythonStudy/111NLP/venv/lib/python3.7/site-packages/torchvision/transforms/transforms.py", line 70, in __call__
img = t(img)
TypeError: ToTensor() takes no arguments012020-05-01 -
胖虎
2020-04-15
那你手动下载一下,没换源吧
012020-04-18
相似问题