tensorflowjs_converter --input_format=tf_hub --quantization_bytes=1 'https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/classification/1' web_model
I get 8-bit quantized model (~4 MB).
ValueError: Unsupported Ops in the model before optimization
FakeQuantWithMinMaxArgs
How to get the "quantops" MobileNet_v1.summary() for beginning? :)
classifier_url ="https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/quantops/classification/3" #@param {type:"string"} classifier.summary()IMAGE_SHAPE = (224, 224) classifier = tf.keras.Sequential([ hub.KerasLayer(classifier_url, input_shape=IMAGE_SHAPE+(3,)) ]) classifier.summary() Model: "sequential_1" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= keras_layer_1 (KerasLayer) (None, 1001) 4255001 ================================================================= Total params: 4,255,001 Trainable params: 0 Non-trainable params: 4,255,001 _________________________________________________________________no layers?
File 'mobilenet_v1_1.tar'
17 020 468 mobilenet_v1_1.0_224_quant.ckpt.data-00000-of-00001 14 644 mobilenet_v1_1.0_224_quant.ckpt.index 5 143 394 mobilenet_v1_1.0_224_quant.ckpt.meta 4 276 352 mobilenet_v1_1.0_224_quant.tflite 885 850 mobilenet_v1_1.0_224_quant_eval.pbtxt 17 173 742 mobilenet_v1_1.0_224_quant_frozen.pb 89 mobilenet_v1_1.0_224_quant_info.txtare there layers somewhere?
TF-Lite: Optimized models hub has a few more models with Quantization-Aware Training in PB format. Anfortunately SSD model is in "tflite" format only yet.