learn2learn icon indicating copy to clipboard operation
learn2learn copied to clipboard

unable to retrieve input images after sampling a task

Open farida-bint opened this issue 2 years ago • 3 comments

Hi,

I tested MAML and Reptile algorithms using mini-imagenet dataset, and the data are sampled using a TasksetDataset,

Question: Is it normal that after the set of tasks are created, the inputs images (the originals) are no longer there? For each batch in the training loop, I tried to plot the samples (images) but I got blank images presenting few points in it.

I wanted to visualize the results (predictions) of each algorithm in a form of : (input image, prediction, label) but got no image.

l2l-pred

farida-bint avatar Oct 24 '23 15:10 farida-bint

[...] and the data are sampled using a TasksetDataset

First of all note that there are only the classes Taskset and TaskDataset, with the latter being deprecated in favor of the first.

Question: Is it normal that after the set of tasks are created, the inputs images (the originals) are no longer there?

Not really, no. I just tested it in the script anil_fc100.py.

Maybe you can share your code?

ImahnShekhzadeh avatar Nov 20 '23 13:11 ImahnShekhzadeh

Thanks a lot for your reply,

I already used the Taskset option and it didn't change the results. Below is a screenshot of a Colab file I used to check the input images after sampling some tasks from mini-imagenet train data.

Before sampling the tasks, the input images are all ok

before-sampling

After sampling, the images seem unavailable or maybe transformed

code-for-sampling result-after-sampling

farida-bint avatar Nov 21 '23 15:11 farida-bint

In general, it is much easier to read code when it is properly formatted in the text msg, take a look here: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks :slightly_smiling_face:

You might be using a wrong order for defining the MetaDataset and the Taskset, take a look here: https://github.com/learnables/learn2learn/blob/master/examples/vision/anil_fc100.py#L80-L91

ImahnShekhzadeh avatar Nov 21 '23 17:11 ImahnShekhzadeh