Code Monkey home page Code Monkey logo

Comments (13)

codylcs avatar codylcs commented on June 1, 2024 3

“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

from lite-hrnet.

codylcs avatar codylcs commented on June 1, 2024 3

i have upload lite_hrnet.py, it can get onnx model but with some warnings ,maybe not influence final result ,link

from lite-hrnet.

zhepherd avatar zhepherd commented on June 1, 2024 2

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

from lite-hrnet.

luohuan2uestc avatar luohuan2uestc commented on June 1, 2024 2

“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

from lite-hrnet.

githubBingoChen avatar githubBingoChen commented on June 1, 2024

Awesome lightweight networks!!
Could you provide ONNX format exporting code?
Thanks~

from lite-hrnet.

luohuan2uestc avatar luohuan2uestc commented on June 1, 2024

“adaptive_avg_pool2d” not support in onnx

from lite-hrnet.

zhepherd avatar zhepherd commented on June 1, 2024

“adaptive_avg_pool2d” not support in onnx

how to convert to onnx?

from lite-hrnet.

ycszen avatar ycszen commented on June 1, 2024

“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.

from lite-hrnet.

codylcs avatar codylcs commented on June 1, 2024

“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

from lite-hrnet.

zhepherd avatar zhepherd commented on June 1, 2024

“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?

from lite-hrnet.

Abby263 avatar Abby263 commented on June 1, 2024

@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 ?

from lite-hrnet.

2050airobert avatar 2050airobert commented on June 1, 2024

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

from lite-hrnet.

viet-hoang-99 avatar viet-hoang-99 commented on June 1, 2024

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

from lite-hrnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.