Project-AgML / AgML

AgML is a centralized framework for agricultural machine learning. AgML provides access to public agricultural datasets for common agricultural deep learning tasks, with standard benchmarks and pretrained models, as well the ability to generate synthetic data and annotations.
Apache License 2.0
185 stars 28 forks source link

Selecting data from PyTorch Dataset leads to dimension mismatch error #2

Closed alexolenskyj closed 3 years ago

alexolenskyj commented 3 years ago

After converting an AgML dataset to a Torch dataset, selecting data gives an error. It seems like this error comes from the conversion between numpy arrays and torch tensors in tftorch:

https://github.com/plant-ai-biophysics-lab/AgML/blob/8fff70422885fe31a4849f150fa2c584bcb721a5/agml/backend/tftorch.py#L144

In the case of the apple flower segmentation dataset, the traceback suggests that the issue is with the annotation array, perhaps because it's a 2D array?

image

In the case of the bean disease and apple detection datasets (I wanted to try classification and object detection examples), it seems like I'm getting the issue with the image itself.

Bean disease: image

Apple Detection: image

amogh7joshi commented 3 years ago

Issue fixed.