Open otivedani opened 3 years ago
the dataset are returning dimensions of (W, H, C) by default, for example on AerialCactus:
AerialCactus
from earthvision.datasets import AerialCactus aci_dataset = AerialCactus('./') print (aci_dataset[0][0].shape) # torch.Size([40, 40, 3]) aci_dloader = DataLoader(aci_dataset, batch_size=1) conv0 = Conv2d(3,128,3) for i, dl in enumerate(aci_dloader): conv0(dl[0]) if i>=0: break
this raises errors when forwarded to layer since the in_dimension of conv2d did not match :
in_dimension
the dataset __getitem__ are returning tensor with shape (C, W, H)
__getitem__
print (aci_dataset[0][0].shape) # torch.Size([3, 40, 40])
this does not raise error.
Google Colab Notebook
while it could be fixed by passing transforms.ToTensor() as the last transform, may I know if this was intentional?
transforms.ToTensor()
Description
the dataset are returning dimensions of (W, H, C) by default, for example on
AerialCactus
:this raises errors when forwarded to layer since the
in_dimension
of conv2d did not match :Expected behavior
the dataset
__getitem__
are returning tensor with shape (C, W, H)this does not raise error.
Environment
Google Colab Notebook
Additional context
while it could be fixed by passing
transforms.ToTensor()
as the last transform, may I know if this was intentional?