Export a detectron2 model to caffe2 format. Args: cfg (CfgNode): a detectron2 config, with extra export-related options added by :func:`add_export_config`. model (nn.Module): a model built by :func:`detectron2.modeling.build_model`. It wi
(cfg, model, inputs)
| 144 | |
| 145 | |
| 146 | def export_caffe2_model(cfg, model, inputs): |
| 147 | """ |
| 148 | Export a detectron2 model to caffe2 format. |
| 149 | |
| 150 | Args: |
| 151 | cfg (CfgNode): a detectron2 config, with extra export-related options |
| 152 | added by :func:`add_export_config`. |
| 153 | model (nn.Module): a model built by |
| 154 | :func:`detectron2.modeling.build_model`. |
| 155 | It will be modified by this function. |
| 156 | inputs: sample inputs that the given model takes for inference. |
| 157 | Will be used to trace the model. |
| 158 | |
| 159 | Returns: |
| 160 | Caffe2Model |
| 161 | """ |
| 162 | return Caffe2Tracer(cfg, model, inputs).export_caffe2() |
| 163 | |
| 164 | |
| 165 | def export_onnx_model(cfg, model, inputs): |