Open polor1010 opened 3 years ago
Awesome lightweight networks!! Could you provide ONNX format exporting code? Thanks~
“adaptive_avg_pool2d” not support in onnx
RuntimeError: Failed to export an ONNX attribute 'onnx::Gather', since it's not constant, please try to make things (e.g., kernel size) static if possible
“adaptive_avg_pool2d” not support in onnx
how to convert to onnx?
“adaptive_avg_pool2d” not support in onnx
how to convert to onnx?
same problem cause by pool ops, some solution:https://github.com/pytorch/pytorch/issues/34743#issuecomment-600861292 but we cant convert adaptive_avg_pool2d to avg_pool.
we can change https://github.com/HRNet/Lite-HRNet/blob/hrnet/models/backbones/litehrnet.py#L29 and https://github.com/HRNet/Lite-HRNet/blob/hrnet/models/backbones/litehrnet.py#L86 to static kernel size avg_pool,maybe need retrain this model
“adaptive_avg_pool2d” not support in onnx
You can directly replace the "adaptive_avg_pool2d" with the normal average pooling with a definite pooling size. Then, it can be converted to onnx format.
“adaptive_avg_pool2d” not support in onnx
how to convert to onnx?
same problem cause by pool ops, some solution:pytorch/pytorch#34743 (comment) but we cant convert adaptive_avg_pool2d to avg_pool.
we can change https://github.com/HRNet/Lite-HRNet/blob/hrnet/models/backbones/litehrnet.py#L29 and https://github.com/HRNet/Lite-HRNet/blob/hrnet/models/backbones/litehrnet.py#L86 to static kernel size avg_pool,maybe need retrain this model
i just have transformed onnx model, but not check,u can download from here
“adaptive_avg_pool2d” not support in onnx
how to convert to onnx?
same problem cause by pool ops, some solution:pytorch/pytorch#34743 (comment) but we cant convert adaptive_avg_pool2d to avg_pool. we can change https://github.com/HRNet/Lite-HRNet/blob/hrnet/models/backbones/litehrnet.py#L29 and https://github.com/HRNet/Lite-HRNet/blob/hrnet/models/backbones/litehrnet.py#L86 to static kernel size avg_pool,maybe need retrain this model
i just have transformed onnx model, but not check,u can download from here
which code change have you made?
“adaptive_avg_pool2d” not support in onnx
how to convert to onnx?
same problem cause by pool ops, some solution:pytorch/pytorch#34743 (comment) but we cant convert adaptive_avg_pool2d to avg_pool. we can change https://github.com/HRNet/Lite-HRNet/blob/hrnet/models/backbones/litehrnet.py#L29 and https://github.com/HRNet/Lite-HRNet/blob/hrnet/models/backbones/litehrnet.py#L86 to static kernel size avg_pool,maybe need retrain this model
i just have transformed onnx model, but not check,u can download from here
which code change have you made? the core thought is change adaptive_avg_pool2d to avg_pool,adjust inputsize and outputsize,here link may help
i have upload lite_hrnet.py, it can get onnx model but with some warnings ,maybe not influence final result ,link
@codylcs Thanks a lot for the scripts. So the onnx model is returning heatmaps of the shape [1, 17, 96, 72] Can you please help me getting the model predicted keypoints using the onnx model ?
hi,@codylcs Do we need retraining the model like litehrnet etc after changing the code as what you did? I have changed the code of litehrnet.py ,yet still the same error? what was wrong ? what should I do after change the code as you said above? It did not work at all! Maybe I should build it or any other operation to make the change effective? BR
this is my another implementation of Lite Hrnet and I have a script to convert model to onnx. See my repo: https://github.com/viet-hoang-99/Lite_HRnet_vh
Hi This is awesome lightweight networks!! I want to test it on other mobile device. Could you provide ONNX format exporting code? Thanks a lot!!