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

Can't pickle local object 'main.<locals>.<lambda>' #63

Open
CarryChouMST opened this issue Jun 5, 2021 · 2 comments
Open

Can't pickle local object 'main.<locals>.<lambda>' #63

CarryChouMST opened this issue Jun 5, 2021 · 2 comments

Comments

@CarryChouMST
Copy link

When I try to run the train.py, it reports an error like this:

  • Can't pickle local object 'main..'

is there anyone know why? And how can I reslove it?

@CarryChouMST
Copy link
Author

This is the reports:
AttributeError: Can't pickle local object 'main..'

@CarryChouMST
Copy link
Author

Traceback (most recent call last):
  File "D:/deep_learning/pytorch_semantic_segmentation_master/train.py", line 220, in <module>
    main(args)
  File "D:/deep_learning/pytorch_semantic_segmentation_master/train.py", line 103, in main
    train(train_loader, net, criterion, optimizer, epoch, train_args)
  File "D:/deep_learning/pytorch_semantic_segmentation_master/train.py", line 111, in train
    for i, data in enumerate(train_loader):
  File "C:\Users\carrychou\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 352, in __iter__
    return self._get_iterator()
  File "C:\Users\carrychou\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 294, in _get_iterator
    return _MultiProcessingDataLoaderIter(self)
  File "C:\Users\carrychou\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 801, in __init__
    w.start()
  File "C:\Users\carrychou\anaconda3\envs\pytorch\lib\multiprocessing\process.py", line 112, in start
    self._popen = self._Popen(self)
  File "C:\Users\carrychou\anaconda3\envs\pytorch\lib\multiprocessing\context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "C:\Users\carrychou\anaconda3\envs\pytorch\lib\multiprocessing\context.py", line 322, in _Popen
    return Popen(process_obj)
  File "C:\Users\carrychou\anaconda3\envs\pytorch\lib\multiprocessing\popen_spawn_win32.py", line 89, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\carrychou\anaconda3\envs\pytorch\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'main.<locals>.<lambda>'

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

1 participant