Using a subset of classes in ImageNet
I'm aware that subsets of ImageNet exist, however they don't fulfill my requirement. I want 50 classes at their native ImageNet resolutions.
To this end, I used torch.utils.data.dataset.Subset to select specific classes from ImageNet. However, it turns out, class labels/indices must be greater than 0 and less than num_classes.
Since ImageNet contains 1000 classes, the idx of my selected classes quickly goes over 50. How can I reassign the class indices and do so in a way that allows for evaluation later down the road as well?
Is there a way more elegant way to select a subset?

I am not sure I understood your conclusions about labels being greater than zero and less than num_classes. The torch.utils.data.Subset helper takes in a torch.utils.data.Dataset and a sequence of indices, they correspond to indices of data points from the Dataset you would like to keep in the subset. These indices have nothing to do with the classes they belong to.
Here's how I would approach this:

Load your dataset through torchvision.datasets (custom datasets would work the same way). Here I will demonstrate it with FashionMNIST since ImageNet's data is not made available directly through torchvision's API.
&gt;&gt;&gt; ds = torchvision.datasets.FashionMNIST('.')
&gt;&gt;&gt; len(ds)
60000


Define the classes you want to select for the subset dataset. And retrieve all indices from the main dataset which correspond to these classes:
&gt;&gt;&gt; targets = [1, 3, 5, 9]
&gt;&gt;&gt; indices = [i for i, label in enumerate(ds.targets) if label in targets]


You have your subset:
&gt;&gt;&gt; ds_subset = Subset(ds, indices)
&gt;&gt;&gt; len(ds_subset)
24000


At this point, you can use a dictionnary to remap your labels using targets:
&gt;&gt;&gt; remap = {i:x for i, x in enumerate(targets)}
{0: 1, 1: 3, 2: 5, 3: 9}

For example:
&gt;&gt;&gt; x, y = ds_subset[10]
&gt;&gt;&gt; y, remap[y] # old_label, new_label
1, 3



