Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#598 Feature/sg 132 models convert

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-132_models_convert
@@ -30,7 +30,8 @@ architecture: resnet18_cifar
 
 
 experiment_name: resnet18_cifar
 experiment_name: resnet18_cifar
 
 
-
+multi_gpu: Off
+num_gpus: 1
 # THE FOLLOWING PARAMS ARE DIRECTLY USED BY HYDRA
 # THE FOLLOWING PARAMS ARE DIRECTLY USED BY HYDRA
 hydra:
 hydra:
   run:
   run:
Discard
    Discard
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    1. # Example conversion parameters, to be used with super_gradients/examples/convert_recipe_example/convert_recipe_example.py
    2. # Suppose you trained cifar10_resnet using train_from_recipe beforehand, Then:
    3. # python convert_recipe_example.py --config-name=cifar10_conversion_params experiment_name=YOUR_EXPERIMENT_NAME.
    4. # Alternatively (or if ckpts are located anywhere else from the default checkpoints dir), you can give the full checkpoint path:
    5. # python convert_recipe_example.py --config-name=cifar10_conversion_params checkpoint_path=YOUR_CHECKPOINT_PATH
    6. defaults:
    7. - default_conversion_params
    8. - _self_
    9. experiment_name: resnet18_cifar # The experiment name used to train the model (optional- ignored when checkpoint_path is given)
    10. # CONVERSION RELATED PARAMS
    11. out_path: # str, Destination path for the .onnx file. When None- out_path will be the resolved checkpoint path replacing .ckpt suffix with .onnx.
    12. input_shape: # input shape, not including batch_size. Always channels first (i.e (3, 224, 224)).
    13. - 3
    14. - 32
    15. - 32
    16. pre_process: # Preprocessing pipeline, will be resolved by TransformsFactory(), and will be baked into the converted model (optional).
    17. Compose:
    18. transforms:
    19. - Standardize
    20. - Normalize:
    21. mean:
    22. - 0.4914
    23. - 0.4822
    24. - 0.4465
    25. std:
    26. - 0.2023
    27. - 0.1994
    28. - 0.2010
    29. post_process: # Postprocessing pipeline, will be resolved by TransformsFactory(), and will be baked into the converted model (optional).
    30. prep_model_for_conversion_kwargs: # For SgModules, args to be passed to model.prep_model_for_conversion prior to torch.onnx.export call.
    31. torch_onnx_export_kwargs: # kwargs (EXCLUDING: FIRST 3 KWARGS- MODEL, F, ARGS). to be unpacked in torch.onnx.export call
    32. opset_version: 16
    Discard
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    1. experiment_name: # The experiment name used to train the model (optional- ignored when checkpoint_path is given)
    2. ckpt_root_dir: # The checkpoint root directory, s.t ckpt_root_dir/experiment_name/ckpt_name resides.
    3. # Can be ignored if the checkpoints directory is the default (i.e path to checkpoints module from contents root), or when checkpoint_path is given
    4. ckpt_name: ckpt_best.pth # Name of the checkpoint to export ("ckpt_latest.pth", "average_model.pth" or "ckpt_best.pth" for instance).
    5. checkpoint_path:
    6. strict_load: no_key_matching # One of [On, Off, no_key_matching] (case insensitive) See super_gradients/common/data_types/enum/strict_load.py
    7. # NOTES ON: ckpt_root_dir, checkpoint_path, and ckpt_name:
    8. # - ckpt_root_dir, experiment_name and ckpt_name are only used when checkpoint_path is None.
    9. # - when checkpoint_path is None, the model will be vuilt according to the output yaml config inside ckpt_root_dir/experiment_name/ckpt_name. Also note that in
    10. # this case its also legal not to pass ckpt_root_dir, which will be resolved to the default SG ckpt dir.
    11. # CONVERSION RELATED PARAMS
    12. out_path: # str, Destination path for the .onnx file. When None- will be set to the checkpoint_path.replace(".ckpt",".onnx").
    13. input_shape: # input shape, not including batch_size. Always channels first (i.e (3, 224, 224)).
    14. pre_process: # Preprocessing pipeline, will be resolved by TransformsFactory(), and will be baked into the converted model (optional).
    15. post_process: # Postprocessing pipeline, will be resolved by TransformsFactory(), and will be baked into the converted model (optional).
    16. prep_model_for_conversion_kwargs: # For SgModules, args to be passed to model.prep_model_for_conversion prior to torch.onnx.export call.
    17. torch_onnx_export_kwargs: # kwargs (EXCLUDING: FIRST 3 KWARGS- MODEL, F, ARGS). to be unpacked in torch.onnx.export call
    Discard