pytorch运行文件报错:PermissionError: [WinError 5] 拒绝访问。

一共报了两个错误:

(1) Traceback (most recent call last):
File “C:/Users/83543/PycharmProjects/graduate/CIFAR-10/VGG-Small/main.py”, line 326, in
Traceback (most recent call last):
File “”, line 1, in
File “D:\120\Python\Python37\lib\multiprocessing\spawn.py”, line 106, in spawn_main
exitcode = _main(fd)
File “D:\120\Python\Python37\lib\multiprocessing\spawn.py”, line 116, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

(2)PermissionError: [WinError 5] 拒绝访问。
首先把(2)的解决了,找到python目录下的python.exe,右键选择属性,安全,把权限打满,再确定。然后把pycharm对应的运行程序exe的权限也打满。

解决方案:

(1)在使用torch.utils.data.DataLoader的时候,把参数num_workers改为0.如下图:
pytorch运行文件报错:PermissionError: [WinError 5] 拒绝访问。_第1张图片
(2)

你可能感兴趣的:(torch)