MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / export_caffe2_model

Function export_caffe2_model

detectron2/export/api.py:146–162  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

144
145
146def 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
165def export_onnx_model(cfg, model, inputs):

Callers 1

_test_modelMethod · 0.90

Calls 2

Caffe2TracerClass · 0.85
export_caffe2Method · 0.80

Tested by 1

_test_modelMethod · 0.72