Skip to content

Error in “python eth_mnist.py --gpu” #3

Description

@Qlina

Hi,
I tried running the example code 'eth_mnist.py' with gpu mode,but error occurs.

`python eth_mnist.py --gpu
C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp

Begin training.

Progress: 0 / 1 (0.0000 seconds)
0%| | 0/60000 [00:00<?, ?it/s]Traceback (most recent call last):
File "eth_mnist.py", line 163, in
for step, batch in enumerate(tqdm(dataloader)):
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\site-packages\tqdm_tqdm.py", line 1017, in iter
for obj in iterable:
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\site-packages\torch\utils\data\dataloader.py", line 193, in iter
return _DataLoaderIter(self)
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\site-packages\torch\utils\data\dataloader.py", line 469, in init
w.start()
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'create_torchvision_dataset_wrapper..TorchvisionDatasetWrapper'

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\spawn.py", line 99, in spawn_main
new_handle = reduction.steal_handle(parent_pid, pipe_handle)
File "C:\Users\81079\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\reduction.py", line 87, in steal_handle
_winapi.DUPLICATE_SAME_ACCESS | _winapi.DUPLICATE_CLOSE_SOURCE)
PermissionError: [WinError 5] `

I have checked the GPU, it can work.
torch.cuda.is_available()
The result is "True".

Is it relate to the operating system? I use windows10 and run this program with anaconda.
Could you give me some hint for how to solve this problem?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions