pytorch-image-models icon indicating copy to clipboard operation
pytorch-image-models copied to clipboard

Moved all argparse configs to .yaml files, added set_deterministic function, added class for easy model evaluation on one image

Open romamartyanov opened this issue 5 years ago • 5 comments

  • Moved all argparse configs to .yaml files. All configs are parsed from the .yaml file. If necessary, any parameter can be written to the terminal as before and these parameters will overwrite the .yaml file. All args are also stored in args_text variable as string.
  • Added set_deterministic function. This function can be useful for checking the representativeness of experiment.
  • Added class for easy model evaluation on one image.

romamartyanov avatar Nov 28 '20 15:11 romamartyanov

I think it would be great if the config system can be like that of detectron2 or mmdetection, as they allow overriding config values through command line args.

hiyyg avatar Nov 29 '20 02:11 hiyyg

I think it would be great if the config system can be like that of detectron2 or mmdetection, as they allow overriding config values through command line args.

This config system can receive command-line arguments as before: python train.py --batch_size=128 --weight_decay=0.001, etc And then these config values will be override and used in pipeline.

romamartyanov avatar Nov 29 '20 14:11 romamartyanov

Does it also allow inheritance from some basic configs?

hiyyg avatar Nov 30 '20 02:11 hiyyg

Thanks for the contribution. I agree that config files can make more sense than the sprawl of args that the scrips here have developed. I had a different (eventual) plan in mind though. I intended to migrate to Hydra or ML Collections, a config scheme with hierarchical / typed struct support.

This approach sits in between those, it keeps the command line more aligned with what exists right now, but it lacks some of the features that'd motivate me to adopt this change. The existing code does support using yaml config files in a half-assed way. I use it all the time for resuming experiments or changing a few items in a sequence of experiments. If you start any train process, grab the args.yaml file in the output folder, you can tweak it to create new configs and just launch with --config my_config.yaml

rwightman avatar Dec 05 '20 19:12 rwightman

Also, the defaults that were placed in the config files in this PR are different and break the standard ImageNet training hparam starting point. I'll keep this PR open as a reference for now and figure out when I'd like to tackle config...

rwightman avatar Dec 05 '20 19:12 rwightman