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

Checkpoint之后报错 #2

Open
smylab opened this issue Jan 15, 2024 · 0 comments
Open

Checkpoint之后报错 #2

smylab opened this issue Jan 15, 2024 · 0 comments

Comments

@smylab
Copy link

smylab commented Jan 15, 2024

检查了很久不知道哪一步数没放到GPU设备上,没改动过代码,求助

Traceback (most recent call last):
File "main.py", line 116, in
main(config)
File "main.py", line 107, in main
solver.train()
File "/pubdata/lyz/SMY/TaylorSENet-main/solver.py", line 107, in train
train_avg_loss = self._run_one_epoch(epoch, val_opt=False)
File "/pubdata/lyz/SMY/TaylorSENet-main/solver.py", line 381, in _run_one_epoch
loss_dict = self._train_batch(batch_info)
File "/pubdata/lyz/SMY/TaylorSENet-main/solver.py", line 368, in train_batch
self.update_params(batch_loss)
File "/pubdata/lyz/SMY/TaylorSENet-main/solver.py", line 424, in update_params
self.optimizer.step()
File "/home/linyz/anaconda3/envs/py38/lib/python3.8/site-packages/torch/optim/optimizer.py", line 88, in wrapper
return func(*args, **kwargs)
File "/home/linyz/anaconda3/envs/py38/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "/home/linyz/anaconda3/envs/py38/lib/python3.8/site-packages/torch/optim/adam.py", line 107, in step
F.adam(params_with_grad,
File "/home/linyz/anaconda3/envs/py38/lib/python3.8/site-packages/torch/optim/functional.py", line 86, in adam
exp_avg.mul
(beta1).add
(grad, alpha=1 - beta1)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

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