Tensorflow Object Detection API Model - Unsupported Ops in ssd_mobilenet_v2 model
See original GitHub issueTo get help from the community, check out our Google group.
TensorFlow.js version
@tensorflow/tfjs-converter: 0.1.1 (this was installed through pip)
Browser version
N/A (issue is related to tensorflowjs_converter)
Describe the problem or feature request
Unsupported Ops
I tried running the tensorflowjs_converter as follows:
tensorflowjs_converter \ --input_format=tf_saved_model \ --output_node_names='detection_boxes,detection_classes,detection_scores,num_detections' \ --saved_model_tags=serve \ ~/workspace/model/saved_model \ ~/workspace/model/web_model
Once it is complete, I get the following output of unsupported ops:
All, Assert, Enter, Exit, LoopCond, Merge, NextIteration, NonMaxSuppressionV2, Rank, ResizeBilinear, Size, Split, StridedSlice, Switch, TensorArrayGatherV3, TensorArrayReadV3, TensorArrayScatterV3, TensorArraySizeV3, TensorArrayV3, TensorArrayWriteV3, TopKV2, Unpack, Where
This is a ssd_mobilenet_v2_coco model trained through tensorflow object detection api. It is performing well on tensorflow, but it contains ops not supported by tensorflowjs. I have tried several other models from the tensorflow model zoo, and they all have similiar unsupported ops.
Code to reproduce the bug / link to feature request
I found this GIST describing the exact issue: Convert Tensorflow SavedModel to WebModel for TF-JS From this GIST I got the following:
# Download the model files.
wget http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v2_coco_2018_03_29.tar.gz
# Untar the model .
tar -xzvf ssd_mobilenet_v2_coco_2018_03_29.tar.gz
pip install tensorflow-gpu # Or just tensorflow for CPU
pip install tensorflowjs
saved_model_cli show --dir ssd_mobilenet_v2_coco_2018_03_29/saved_model --tag_set serve --signature_def serving_default
tensorflowjs_converter \
--input_format=tf_saved_model \
--output_node_names='detection_boxes,detection_scores,num_detections,detection_classes' \
--saved_model_tags=serve \
./ssd_mobilenet_v2_coco_2018_03_29/saved_model \
./ssd_mobilenet_v2_coco_2018_03_29/web_model
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:43 (13 by maintainers)
Top GitHub Comments
We are actively working on this. I expect we’ll get this done in 1-2 weeks. Stay tuned.
It would be really cool to have support to TF object detection api models. As of now I installed tfjs-converter (through pip) and got the following unsupported ops (including some of which were already reported earlier) for a ssdlite mobilenet v2: