MCPcopy
hub / github.com/ultralytics/yolov5 / export_paddle

Function export_paddle

export.py:204–215  ·  view source on GitHub ↗
(model, im, file, metadata, prefix=colorstr('PaddlePaddle:'))

Source from the content-addressed store, hash-verified

202
203@try_export
204def export_paddle(model, im, file, metadata, prefix=colorstr('PaddlePaddle:')):
205 # YOLOv5 Paddle export
206 check_requirements(('paddlepaddle', 'x2paddle'))
207 import x2paddle
208 from x2paddle.convert import pytorch2paddle
209
210 LOGGER.info(f'\n{prefix} starting export with X2Paddle {x2paddle.__version__}...')
211 f = str(file).replace('.pt', f'_paddle_model{os.sep}')
212
213 pytorch2paddle(module=model, save_dir=f, jit_type='trace', input_examples=[im]) # export
214 yaml_save(Path(f) / file.with_suffix('.yaml').name, metadata) # add metadata.yaml
215 return f, None
216
217
218@try_export

Callers 1

runFunction · 0.85

Calls 4

colorstrFunction · 0.90
check_requirementsFunction · 0.90
yaml_saveFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected