-
Notifications
You must be signed in to change notification settings - Fork 88
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
Tensor's device mismatch #96
Comments
Can you please give a code example that reproduces this error as well as copying the full stack trace? |
To reproduce:
Possible solutionI have solved this bug by specifying the device when using chemicalx/chemicalx/models/caster.py Line 106 in 4222a67
chemicalx/chemicalx/models/caster.py Line 124 in 4222a67
to dict_feat_squared_inv = torch.inverse(dict_feat_squared + self.lambda3 * (torch.eye(self.drug_channels, device=drug_pair_features_latent.device)))
dictionary_features_latent = self.encoder(torch.eye(self.drug_channels, device=drug_pair_features.device)) Another similar bugTo reproduce this one, just run the
I think it was caused by the numpy manipulation, since the numpy did not allowed to be compute on the GPUs. chemicalx/chemicalx/models/mhcaddi.py Lines 461 to 464 in 4222a67
|
Hi all, any updates about the numpy issue? @hzcheney @cthoyt @benedekrozemberczki |
Hi! I have found a bug during the training of the caster model. It was caused by the
torch.eye
manipulation, simply it did not specify the device. When the Cuda is available,torch.eye
will create the tensor on the CPU while the whole model is on the GPU.The text was updated successfully, but these errors were encountered: