Save the ONNX model to the given location. :param output_path: Path pointing to the location where to write out the updated ONNX model.
(self, output_path)
| 103 | break |
| 104 | |
| 105 | def save(self, output_path): |
| 106 | """ |
| 107 | Save the ONNX model to the given location. |
| 108 | :param output_path: Path pointing to the location where to write out the updated ONNX model. |
| 109 | """ |
| 110 | self.graph.cleanup().toposort() |
| 111 | model = gs.export_onnx(self.graph) |
| 112 | output_path = os.path.realpath(output_path) |
| 113 | os.makedirs(os.path.dirname(output_path), exist_ok=True) |
| 114 | onnx.save(model, output_path) |
| 115 | log.info("Saved ONNX model to {}".format(output_path)) |
| 116 | |
| 117 | def update_preprocessor(self, input_format, input_size, preprocessor="imagenet"): |
| 118 | """ |
no test coverage detected