Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AssertionError: If capturable=False, state_steps should not be CUDA tensors

I get this error while loading model weights of a previous epoch on Google colab. I'm using PyTorch version 1.12.0. I can't downgrade to a lower version as there are external libraries that Im using that require Pytorch 1.12.0

Thanks!

like image 459
StanWarne Avatar asked Oct 26 '25 08:10

StanWarne


1 Answers

It seems related to a newly introduced parameter (capturable) for the Adam and AdamW optimizers. Currently two workarounds:

  1. forcing capturable = True after loading the checkpoint optim.param_groups[0]['capturable'] = True. This seems to slow down the model training by approx. 10% (YMMV depending on the setup).
  2. Reverting PyTorch back to previous versions (could be 1.11.0).

Source: https://github.com/pytorch/pytorch/issues/80809#issuecomment-1173481031

like image 172
Abu Ubaida Avatar answered Oct 29 '25 07:10

Abu Ubaida



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!