Attempting zero-shot training

I am interested in the predictions of ImageNet34 on my data, in order to gain an understanding how much of the accuracy is due to the (small) training dataset, and how much is simply due to ImageNet34’s weights.

So, I am attempting to create a dataset with an empty training set, and then learn from it.

However, it doesn’t work, throwing an error “IndexError: index 0 is out of bounds for axis 0 with size 0”

I think it tries to index the empty dataset, and thus throws this error.

Is there a built-in way in which I can try zero-shot training, based on ImageNet?

1 Like

Just grab the resnet model as such:

resnet = models.resnet34

Replace the last layer with an nn.Linear(1000, <# of classes you are trying to predict>) and use this as your model for training.

Many thanks.

There’s another (similar) issue I am facing :

I want to import someone else’s model, and use that as a baseline for the training on my data. i.e. train not on the default resnet model, but on someone else’s.

An additional complication is that my dataset, and the model of the other person I am using have a different amount of classes.

Both this question and the previous one might imply that I am missing something basic about the structure of … If that is so, is there a specific lesson\resource where I can learn this from?