update_params

Update the parameters embedded into a generated .tflite model file.

Additional Documentation

Usage

                                                                                                                                                                                                                                                                                               
 Usage: yzlite update_params [OPTIONS] <model>                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                               
 Update the parameters of a previously trained model                                                                                                                                                                                                                                           
 This updates the metadata of a previously trained .tflite model.                                                                                                                                                                                                                              
 The parameters are taken from either the given YZLiteModel's python script                                                                                                                                                                                                                      
 or the given "params" .json/.yaml file. Additional int/float/str parameters can also be                                                                                                                                                                                                       
 given on the command line (see examples below).                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                               
 NOTE: The .tflite metadata is only modified.                                                                                                                                                                                                                                                  
 The weights and model structure of the .tflite file are NOT modified.                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                               
 For more details see:                                                                                                                                                                                                                                                                         
 https://github.com/ReRAM-Labs/yzlite/docs/guides/model_parameters                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                               
 ----------                                                                                                                                                                                                                                                                                    
  Examples                                                                                                                                                                                                                                                                                     
 ----------                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                               
 # Update the tflite_micro_speech model parameters with any modifications                                                                                                                                                                                                                      
 # made in yzlite/models/tflite_micro/tflite_micro_speech.py                                                                                                                                                                                                                                     
 # The associated model archive is updated with the updated .tflite                                                                                                                                                                                                                            
 yzlite update_params tflite_micro_speech                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                               
 # Update my_model.tflite with parameters in my_params.json                                                                                                                                                                                                                                    
 # Also update the model description                                                                                                                                                                                                                                                           
 yzlite update_params my_model.tflite --params my_params.json --description "My model is great!"                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                               
 # Update my_model.tflite with additional params on the command-line                                                                                                                                                                                                                           
 yzlite update_params my_model.tflite my_custom_param="some value" led_period_ms=43                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                               
 Arguments 
 *    model      <model>  One of the following:                         [default: None] [required]                                                                                                                                                                                           
                          - Name of trained YZLITE model                                                                                                                                                                                                                                       
                          - Path to trained model's archive (.yzlite.zip)                                                                                                                                                                                                                      
                          - Path to .tflite model file                                                                                                                                                                                                                                       

 Options 
 --params       -p      <params path>  Optional path to .json or .yaml file contains parameters to add to given model [default: None]                                                                                                                                                        
 --description  -d      <description>  Optional description to add to the generated .tflite [default: None]                                                                                                                                                                                  
 --verbose      -v                     Enable verbose console logs                                                                                                                                                                                                                           
 --output       -o      <path>         One of the following:                                                                                                 [default: None]                                                                                                                 
                                       - Path to generated output .tflite file                                                                                                                                                                                                               
                                       - Directory where output .tflite is generated                                                                                                                                                                                                         
                                       - If omitted, .tflite is generated in the YZLITE model's log directory and the model archive is updated (if applicable)                                                                                                                                 
 --accelerator  -a      <accelerator>  Optional accelerator to use when calculating the "runtime_memory_size" model parameter. If omitted then use the CMSIS kernels [default: None]                                                                                                         
 --device       -d                     If provided, program the updated .tflite to end of the flash memory of the the connected device.                                                                                                                                                      
                                       Supported apps (e.g. model_profiler, audio_classifier, etc) will use this .tflite instead of the default model.                                                                                                                                       
                                       This allows for making changes to the model without re-building the firmware application.                                                                                                                                                             
                                       If this option is provided, then the device must be locally connected                                                                                                                                                                                 
 --help                                Show this message and exit.