Hi all,
I am currently using Tensorflow v2.14.1 and Keras to train my model with MobileNetV2 as the base model. The model is as shown:
`_________________________________________________________________
Layer (type) Output Shape Param #
lambda_3 (Lambda) (None, 224, 224, 3) 0
mobilenetv2_0.35_224 (Func (None, 7, 7, 1280) 410208
tional)
global_average_pooling2d_1 (None, 1280) 0
2 (GlobalAveragePooling2D)
dropout_12 (Dropout) (None, 1280) 0
dense_12 (Dense) (None, 3) 3843
=================================================================
Total params: 414051 (1.58 MB)
Trainable params: 3843 (15.01 KB)
Non-trainable params: 410208 (1.56 MB)
_________________________________________________________________`
After training, I have encountered issues importing the .h5 output using the pegasus_import script with the following line:
I Try match mobilenetv2_0.35_224
W Unsupport layer type Functional need add
I Try match rescaling
W Unsupport layer type Rescaling need add.
The issue is solved by converting the .h5 Keras model to .tflite and the import succeeds but with the following warning:
I Start importing tflite…
W Unsupport attribute fold_const_inputs
Since there is a warning, I would like to ask whether this is the proper way to import a model with MobileNetV2 as the base model.
Other than that, I would like to ask what do the fields in the xxx_inputmeta.yml mean and what should I configure since I see there are different configurations for different model types. The link for the guide to change the fields according to the imported model is also missing ( NN Model Conversion Steps using Acuity Toolkit on Docker — AmebaPro2's Documentation v0.1 documentation )
Once import is successful, kindly refer to this page to modify the
inputmeta.ymlaccording to the type of imported model.
Therefore, do I need to change the scale if I already have a lambda layer to scale pixel values between -1 and 1?
Finally, I see that there is a cropping option in the xxx_inputmeta.yml and a ROI option (void NNImageClassification::configRegionOfInterest(int xmin, int xmax, int ymin, int ymax)) in the ArduinoSDK. Which one should I use to first center crop 640 x 640 and then resize to 224 x 224?
I’m quite new to all of this so thanks for all the help in advance!
