下面是我输入的代码:
import torch
from IPython import display
from d2l import torch as d2l
batch_size = 256
train_iter, test_iter = d2l.load_data_fashion_mnist(batch_size)
下面的我的报错:
PermissionError Traceback (most recent call last)
in
4
5 batch_size = 256
----> 6 train_iter, test_iter = d2l.load_data_fashion_mnist(batch_size)
~\anaconda3\envs\pytorch\lib\site-packages\d2l\torch.py in load_data_fashion_mnist(batch_size, resize)
207 train=True,
208 transform=trans,
--> 209 download=True)
210 mnist_test = torchvision.datasets.FashionMNIST(root="../data",
211 train=False,
~\anaconda3\envs\pytorch\lib\site-packages\torchvision\datasets\mnist.py in init(self, root, train, transform, target_transform, download)
85
86 if download:
---> 87 self.download()
88
89 if not self._check_exists():
~\anaconda3\envs\pytorch\lib\site-packages\torchvision\datasets\mnist.py in download(self)
166 return
167
--> 168 os.makedirs(self.raw_folder, exist_ok=True)
169
170 # download files
~\anaconda3\envs\pytorch\lib\os.py in makedirs(name, mode, exist_ok)
208 if head and tail and not path.exists(head):
209 try:
--> 210 makedirs(head, mode, exist_ok)
211 except FileExistsError:
212 # Defeats race condition when another thread created the path
~\anaconda3\envs\pytorch\lib\os.py in makedirs(name, mode, exist_ok)
208 if head and tail and not path.exists(head):
209 try:
--> 210 makedirs(head, mode, exist_ok)
211 except FileExistsError:
212 # Defeats race condition when another thread created the path
~\anaconda3\envs\pytorch\lib\os.py in makedirs(name, mode, exist_ok)
218 return
219 try:
--> 220 mkdir(name, mode)
221 except OSError:
222 # Cannot rely on checking for EEXIST, since the operating system
PermissionError: [WinError 5] 拒绝访问。: '../data'
直接在Anaconda3文件夹下面的Jupyter Notebook(d2l)右键——更多——以管理员方式运行
然后重新运行就可以了
同样是这个问题,后面怎么解决的啊?
你好,想问下你解决了嘛
同问 怎么解决呢??