sacmehta / EdgeNets

This repository contains the source code of our work on designing efficient CNNs for computer vision
MIT License
411 stars 82 forks source link

to onnx #1

Closed kingvision closed 5 years ago

kingvision commented 5 years ago

I have tried to convert pytorch model to onnx with api (torch.onnx.export), but I meet a problem showing below info Failed to export an ONNX attribute, since it's not constant, please try to make things (e.g., kernel size) static if possible How could I fix it ?

sacmehta commented 5 years ago

Which model in onnx are you looking for?

sacmehta commented 5 years ago

I have added ESPNetv2 onnx compatible models.

See here: https://github.com/sacmehta/EdgeNets/tree/master/onnx_models/classification/espnetv2

kingvision commented 5 years ago

thanks, Can you provide code to turn onnx? What I need is to train my own data model and then turn it into an onnx model.

sacmehta commented 5 years ago

Unfortunately, I cannot provide it now because we are checking its stability across different models. However, we will be releasing it sometime next month.

kingvision commented 5 years ago

I export an onnx model for segment, I got the follow error: RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things (e.g., kernel size) static if possible

How i can fix it?

YuriyPryyma commented 5 years ago

@sacmehta I`m exporting to onnx and got error "upsample_bilinear2d" If try to fix it as mentioned in this issue After that I got "upsample_bilinear2d because align_corners == True not supported" when i change align_corners == True to False I got "RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things (e.g., kernel size) static if possible"