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

unable to start training using pretrained weigths #4

Closed
dev-srikanth opened this issue Aug 8, 2019 · 3 comments
Closed

unable to start training using pretrained weigths #4

dev-srikanth opened this issue Aug 8, 2019 · 3 comments

Comments

@dev-srikanth
Copy link

whenever pre-trained weights are used for training the model using own dataset, the following error is occurring.

python3 train.py --batch-size 4 --checkpoint checkpoint/BEST_checkpoint.tar

/usr/local/lib/python3.5/dist-packages/torch/serialization.py:454: SourceChangeWarning: source code of class 'torch.nn.parallel.data_parallel.DataParallel' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/usr/local/lib/python3.5/dist-packages/torch/serialization.py:454: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/usr/local/lib/python3.5/dist-packages/torch/serialization.py:454: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/usr/local/lib/python3.5/dist-packages/torch/serialization.py:454: SourceChangeWarning: source code of class 'torch.nn.modules.activation.ReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
File "train.py", line 180, in
main()
File "train.py", line 176, in main
train_net(args)
File "train.py", line 71, in train_net
logger=logger)
File "train.py", line 112, in train
alpha_out = model(img) # [N, 3, 320, 320]
File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/torch/nn/parallel/data_parallel.py", line 143, in forward
if t.device != self.src_device_obj:
File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 539, in getattr
type(self).name, name))
AttributeError: 'DataParallel' object has no attribute 'src_device_obj'

@foamliu
Copy link
Owner

foamliu commented Aug 19, 2019

Are you using GPU?

@foamliu
Copy link
Owner

foamliu commented Aug 28, 2019

Fixed, feel free to activate this if it repro.

@foamliu foamliu closed this as completed Aug 28, 2019
@dev-srikanth
Copy link
Author

@foamliu yes, I'm using a GPU.

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