Skip to content
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

Suggestion for datasets __getitem__ image dimensions #90

Open
otivedani opened this issue Nov 1, 2021 · 0 comments
Open

Suggestion for datasets __getitem__ image dimensions #90

otivedani opened this issue Nov 1, 2021 · 0 comments

Comments

@otivedani
Copy link

Description

the dataset are returning dimensions of (W, H, C) by default, for example on 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 :
image

Expected behavior

the dataset __getitem__ are returning tensor with shape (C, W, H)

print (aci_dataset[0][0].shape)  # torch.Size([3, 40, 40])

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant