update_model_parameters¶
- update_model_parameters(model, params=None, description=None, output=None, accelerator=None)[source]¶
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
mltk.core.MltkModel
’s python script or the given “params” dictionary and added to the .tflite model file.Note
The .tflite metadata is only modified. The weights and model structure of the .tflite file are NOT modified.
- Parameters:
model (
Union
[MltkModel
,TfliteModel
,str
]) – Either the name of a model amltk.core.MltkModel
ormltk.core.TfliteModel
instance or the path to a .tflite model file or .mltk.zip model archiveparams (
dict
) – Optional dictionary of parameters to add .tflite. If omitted then model argument must be amltk.core.MltkModel
instance or model namedescription (
str
) – Optional description to add to .tfliteoutput (
str
) – Optional, directory path or file path to generated .tflite file. If none then generate in model log directory. If output=’tflite_model’, then return themltk.core.TfliteModel
object instead of .tflite file pathaccelerator (
str
) – Optional hardware accelerator to use when determining theruntime_memory_size
parameter. If None then default to the CMSIS kernels for calculating the required tensor arena size.
- Return type:
Union
[str
,TfliteModel
]- Returns:
The file path to the generated .tflite OR TfliteModel object if output=`tflite_model`