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

AttributeError: Can't pickle local object 'train.<locals>.<lambda>' #18

Open
wangjuenew opened this issue Aug 22, 2023 · 1 comment
Open

Comments

@wangjuenew
Copy link

D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\python.exe train.py --config configs/gnt_llff.txt --train_scenes fern --eval_scenes fern
Setting up [LPIPS] perceptual loss: trunk [alex], v[0.1], spatial [off]
D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' in
stead.
warnings.warn(
D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in th
e future. The current behavior is equivalent to passing weights=AlexNet_Weights.IMAGENET1K_V1. You can also use weights=AlexNet_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
Loading model from: D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\lpips\weights\v0.1\alex.pth
Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in th
e future. The current behavior is equivalent to passing weights=VGG16_Weights.IMAGENET1K_V1. You can also use weights=VGG16_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
Loading model from: D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\lpips\weights\v0.1\vgg.pth
outputs will be saved to ./out\gnt_llff
training dataset: llff_test
loading ['fern'] for train
loading ['fern'] for validation
No ckpts found, training from scratch...
Traceback (most recent call last):
File "D:\code\3D_Reconstruction\GNT\train.py", line 319, in
train(args)
File "D:\code\3D_Reconstruction\GNT\train.py", line 97, in train
for train_data in train_loader:
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 441, in iter
return self._get_iterator()
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 388, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 1042, in init
w.start()
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\multiprocessing\popen_spawn_win32.py", line 93, in init
reduction.dump(process_obj, to_child)
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'train..'
PS D:\code\3D_Reconstruction\GNT> Setting up [LPIPS] perceptual loss: trunk [alex], v[0.1], spatial [off]
D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' in
stead.
warnings.warn(
D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in th
e future. The current behavior is equivalent to passing weights=AlexNet_Weights.IMAGENET1K_V1. You can also use weights=AlexNet_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
Loading model from: D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\lpips\weights\v0.1\alex.pth
Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in th
e future. The current behavior is equivalent to passing weights=VGG16_Weights.IMAGENET1K_V1. You can also use weights=VGG16_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
Loading model from: D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\site-packages\lpips\weights\v0.1\vgg.pth
Traceback (most recent call last):
File "", line 1, in
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "D:\Users\gracejwang\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 126, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

@yafeiya
Copy link

yafeiya commented Nov 6, 2023

set num_workers=0

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