Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello, an error occurred while 'train_loop' function was running #6

Open
JOY-chen811 opened this issue May 6, 2020 · 1 comment
Open

Comments

@JOY-chen811
Copy link

In the functiondef 'train_loop' defined in the main function, this statement run error:
for data in tqdm(trainloader, desc='Training for epoch ' + str(epoch)):
I want to ask what changes should been made?
This is an error message:
'Training for epoch 0: 0%| | 0/594 [00:00<?, ?it/s]Traceback (most recent call last):
File "D:/毕设/tirg-master/tirg-master/main.py", line 299, in
main()
File "D:/毕设/tirg-master/tirg-master/main.py", line 294, in main
train_loop(opt, logger, trainset, testset, model, optimizer)
File "D:/毕设/tirg-master/tirg-master/main.py", line 267, in train_loop
for data in tqdm(trainloader, desc='Training for epoch ' + str(epoch)):
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\tqdm\std.py", line 1108, in iter
for obj in iterable:
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 279, in iter
return _MultiProcessingDataLoaderIter(self)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 719, in init
w.start()
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\multiprocessing\context.py", line 212, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\multiprocessing\context.py", line 313, in _Popen
return Popen(process_obj)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\multiprocessing\popen_spawn_win32.py", line 66, in init
reduction.dump(process_obj, to_child)
File "C:\ProgramData\Anaconda3\envs\pytorch\lib\multiprocessing\reduction.py", line 59, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'BaseDataset.get_loader..'
Training for epoch 0: 0%| | 0/594 [00:01<?, ?it/s]'

Looking forward to your reply,Thank you very much.

@lugiavn
Copy link
Collaborator

lugiavn commented May 16, 2020

maybe --loader_num_workers=0 will help
Or try on systems other than windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants