microsoft / Cream

This is a collection of our NAS and Vision Transformer work.
MIT License
1.66k stars 225 forks source link

EfficientVit's inference and ONNX convert #173

Closed alexliyang closed 1 year ago

alexliyang commented 1 year ago

hi, your work is amazing. Can you share the inference test code and convert to onnx code? thx.

xinyuliu-jeffrey commented 1 year ago

Hi @alexliyang ,

Thanks for your interest! For inference, please follow the provided instructions here: https://github.com/microsoft/Cream/tree/main/EfficientViT/classification#evaluation. For onnx convert, just follow the instructions here and use the torch.onnx.export function: torch.onnx.export(model, dummy_inputs, onnx_fname, export_params=True, verbose=False, training=torch.onnx.TrainingMode.EVAL, opset_version=11)