-
Notifications
You must be signed in to change notification settings - Fork 403
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
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor #2492
Comments
Tried setting
|
This error is because BigEarthNet is a multilabel classification dataset but you're using ClassificationTask which is for multiclass problems. Changing ClassificationTask -> MultiLabelClassificationTask should do the trick. |
Switching to Resolved by setting: x = batch['image'].to(self.device) |
Yep, that's definitely Lightning-AI/pytorch-lightning#20456. |
@robmarkcole potentially also kornia/kornia#3066 ? There was a bug in kornia which would take one of the tensors to CPU and then I encountered a similar error. So I would check in the |
Is this still an issue, or was this fixed in newer versions of our dependencies? |
I am experiencing the same bug when trying to use the ''SemanticSegmentationTask’’’ reproducing something similar to the LEVIR-CD+ change detection example notebook with a custom dataset. I am using the latest stable release of torchgeo:
When I pip install the 0.7.0.dev0 version into my conda env I get the same error.
It should be noted, that the error also occurs when I get rid of all kornia augmentations in my custom DataModule. Overwriting the |
Description
Relates to Lightning-AI/pytorch-lightning#20456 I believe. Not sure if there is a workaround?
Steps to reproduce
Returns
Version
0.6.2
The text was updated successfully, but these errors were encountered: