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

torch.nn.modules.module.ModuleAttributeError: 'TaxiBJTrainer' object has no attribute 'seek' #5

Open
qiaoyifan opened this issue Jan 24, 2021 · 1 comment

Comments

@qiaoyifan
Copy link

The error "torch.nn.modules.module.ModuleAttributeError: 'TaxiBJTrainer' object has no attribute 'seek'" occurs when I set the resume=True. I change the code in trainer.py
if resume:
checkpoint = torch.load(self, ckpt_path)
epoch = checkpoint["epoch"]
model.load_state_dict(checkpoint["state_dict"])
to
if resume:
checkpoint = torch.load(ckpt_path)
epoch = checkpoint["epoch"]
self.load_state_dict(checkpoint["state_dict"])
which fix the error.

@zhaojieting
Copy link

Thanks, help a lot.

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