You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm not using imagenet, but during inference it loads the imagenet class_map by default.
Describe the solution you'd like
Instead, the class_to_idx from the dataset_train.reader.class_to_idx should just be saved somewhere inside the model, and be loaded into class_map during inference by default. and of course, if someone still wants to override the class_map for whatever reason, they could still do so.
I'd make a PR myself, but y'all probably have other consideration for exactly where to save/load it, so here's a sample solution.
Describe alternatives you've considered
We could save the class_to_idx into a class map file and ship it along side the model, but that's cumbersome and tedious. The proposed solution just works by default.
Additional context
The same should probably be done with the args.yaml file. There are a ton of timm models on hugging face with pretrained weights, but no args.yaml file with them which makes it near impossible to reproduce their results.
The text was updated successfully, but these errors were encountered:
@JustinMBrown it's a reasonable idea, only issue is that it ends up being a big change, ALL pretrained checkpoints right now are bare state_dict with no extra layer in the dict, every key is a param/buffer and every value a tensor. The train checkpoints (which do have extra keys ) are stripped of everything but the state dict before being published. I followed torchvision and other 'original' libs when this decision was made long ago.
I think I should stash the args in the train state dict regardless though, I've though about this as I've had numerous instances where I toasted the original train folders in disk cleanup and have only the checkpoint left and lost the hparams :/
Although I will point out, I've had multiple occasions where people have been provided with exact hparams, and I get an angry 'it doesn't work' because they don't understand things change when you change the global batch size, use a different dataset, etc the highest value is seeing templates and building an intuition for how to adapt different recipe templates in different uses ...
Is your feature request related to a problem? Please describe.
I'm not using imagenet, but during inference it loads the imagenet class_map by default.
Describe the solution you'd like
Instead, the class_to_idx from the dataset_train.reader.class_to_idx should just be saved somewhere inside the model, and be loaded into class_map during inference by default. and of course, if someone still wants to override the class_map for whatever reason, they could still do so.
I'd make a PR myself, but y'all probably have other consideration for exactly where to save/load it, so here's a sample solution.
Sample solution:
Describe alternatives you've considered
We could save the class_to_idx into a class map file and ship it along side the model, but that's cumbersome and tedious. The proposed solution just works by default.
Additional context
The same should probably be done with the args.yaml file. There are a ton of timm models on hugging face with pretrained weights, but no args.yaml file with them which makes it near impossible to reproduce their results.
The text was updated successfully, but these errors were encountered: