Supporting Faster RCNN and Mask RCNN models

Hi,

I would like to evaluate a Faster RCNN model on TVM. Is there any existing example doing this? Could someone share it here?

Thanks

Hi,
I’m replying to this thread as I think the issues are closely related. I’m interested in running maskrcnn_benchmark in TVM (specifically e2e_mask_rcnn_X-152-32x8d-FPN-IN5k_1.44x_caffe2). I’ve tried with pytorch_tvm (using torch.jit.trace()), and also converting first to onnx (and using then relay.frontend.from_onnx()), to no success (missing operators in the latter case). I’ve also tried converting from pytorch to mxnet, but no luck either. Is there any plan on supporting the missing operators using onnx or pytorch_tvm? (btw my target would be CPU). Thx in advance.

At least for Tensorflow there is some ongoing work to support NonMaxSuppression which is a key operator for these kind of models. A PR is expected soon by @yongwww

Hi @tico, thx for the prompt reply! I’ll keep an eye on the mentioned PR, I hope it is uploaded soon :slight_smile:

We are working on enabling mask-rcnn, fast-rcnn, faster-rcnn, ssd, etc support in TVM. Hopefully all of these models will be supported before end of this year. Welcome to contribute!

Hi @yongwww,

Thanks for your reply! I’m glad to know that we will have a working implementation in the following months. About contributing, I understand that there is a group already working on this specific issue, could you please give some direction on how to contact them? Thx again for your support.

Are ops supported in CPU?

@tico @javier I have sent out the pr for dynamic nms for tensorflow - https://github.com/apache/incubator-tvm/pull/4312

1 Like

Hi @yongwww, awesome! Thanks for the efforts! Looking forward to give it try once merged in the master!

How to get ROIPooling

Hi, can the newest version of TVM run the TensorFlow MaskRCNN model??

Hi, execuse me! can the newest version of TVM support tensorflow MaskRCNN model??? and if can where your MaskRCNN model get? I get the keras model from “https://github.com/matterport/Mask_RCNN” and transfrom it to TensorFlow model. Now there are three Ops which TVM can not support as ‘DenseToDenseSetOperation’, ‘SparseToDense’, ‘Unique’. tks

Yes, MaskRCNN is supported now, you can get the model from TF object detection model zoo.

yes, I had downloaded the model “mask_rcnn_resnet50_atrous_coco_2018_01_28.tar.gz” from the model zoo. But TVM costs long time to compile it about one hour(It is so long time when TVM parses Tensorflow MaskRCNN model). please have you compiled the model before? and is it the same as my result. thanks very much!

We have tested all models in TF object detection model zoo. As Yao said, the long compilation time is expected at this time, it is caused by some VM passes, there are some improvement work on this.

thank you very much!

Hi, I downloaded the model MaskRCNN-resnet50 from “http://download.tensorflow.org/models/object_detection/mask_rcnn_resnet50_atrous_coco_2018_01_28.tar.gz” but it occurs an error as below,

     // Visitor pattern override.
  void VisitExpr_(const LetNode* call) { LOG(FATAL) << "FoldScaleAxis only accept dataflow-form"; }

in fold_scale_axis.cc file. did you find some similiar errors? and how can I fix it? thks!

You can disable this pass when doing compilation.

@kevinthesun, hi when I run this MaskRCNN model, I found there are some shapes are not defined. if TVM support these undefined shapes and how it can run this? thanks very much. image

These are dynamic shapes which determined at runtime. Relay VM handles them.