learn2learn icon indicating copy to clipboard operation
learn2learn copied to clipboard

Return pytorch tensor for mini-imagenet labels?

Open pietrolesci opened this issue 3 years ago • 2 comments

https://github.com/learnables/learn2learn/blob/06893e847693a0227d5f35a6e065e6161bb08201/learn2learn/vision/datasets/mini_imagenet.py#L111

Currently, when loading mini-imagenet the inputs are returned as pytorch tensors while the labels as numpy arrays. Since the user will likely use both in a training loop, does it make sense to cast the labels for long pytorch tensors?

pietrolesci avatar Sep 10 '21 15:09 pietrolesci

Thanks for spotting this and the docstring (#258) issue in mini-ImageNet @pietrolesci. Yes, both should be tensors.

In fact, let me piggy-back and mention one more issue: in the benchmarks, mini-ImageNet and tiered-ImageNet return samples with different input ranges, with data_augmentation=None. (Tiered is 0-1 but mini is 0-255.) Ideally, all vision benchmarks would have the same ranges and types by default, probably 0-255 uint8 for images.

seba-1511 avatar Sep 15 '21 18:09 seba-1511

Hi @seba-1511, thanks for picking this up and for your answer :)

pietrolesci avatar Sep 16 '21 09:09 pietrolesci