-
Notifications
You must be signed in to change notification settings - Fork 68
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_device errors in latest builds #1118
Comments
Breaking this down after further investigation: The "y is not a torch_device" error is actually to do with the use of safetensors. If I set The second "length" error only happens within Rstudio, I'm guessing as it automatically tries to determine it's length for the environment pane or something. More of a cosmetic issue. |
Thanks I see you've addressed the second point already. I've pinpointed the first issue. It seems that the 'device' argument of Specifically where this was causing an issue was with loading of an optimizer state dict to the correct device, in the context of something like the code below: device <- torch_device("cuda:0")
net <- torch_load(modelfile)
net$to(device = device)$train()
optimiser <- optim_adam(net$parameters)
optimiser$load_state_dict(torch_load(optimfile, device = device)) This worked before, but now the second |
Thanks for the investigation @shikokuchuo ! This was really helpful! I think #1122 will fix it |
Thanks, can confirm this fixes the issue. |
I am encountering
runtime_error("y is not a torch_device")
which is your
==.torch_device
method's error message using the latest development build oftorch
fe44f6b in a script which creates a torch device and works withtorch
<= 0.11.0.Moreover I get the following:
which seems to be a regression caused by #1111
The text was updated successfully, but these errors were encountered: