Giter Club home page Giter Club logo

Comments (10)

denisvmedyantsev avatar denisvmedyantsev commented on May 22, 2024 3

I faced the problem of the pytorch -> onnx -> tensorrt approach as above. I used simplifier, it helped, but I found a new problem: the output is different for different batch size for the trt engine. Fix the interpolation instead of using the simplifier in

up3 = F.interpolate(output3, size=[output2.size(2), output2.size(3)], mode="nearest")
and
up2 = F.interpolate(output2, size=[output1.size(2), output1.size(3)], mode="nearest")
It helped. Just cast size to int, eg. F.interpolate(output3, size=[output2.size(2), output2.size(3)], mode="nearest") => F.interpolate(output3, size=(int(output2.size(2)), int(output2.size(3))), mode="nearest")

from pytorch_retinaface.

biubug6 avatar biubug6 commented on May 22, 2024 1

can you export onnx?

It's easy. I'll provide it later .

from pytorch_retinaface.

piotr-anyvision avatar piotr-anyvision commented on May 22, 2024

@biubug6 If you could do it, that would be amazing!

from pytorch_retinaface.

SnowRipple avatar SnowRipple commented on May 22, 2024

@biubug6 Do you have any timetable for the onnx model please?

from pytorch_retinaface.

biubug6 avatar biubug6 commented on May 22, 2024

@SnowRipple @wangpupanjing So sorry to have kept you waiting. Now I provide script "convert_to_onnx.py" to export onnx.

from pytorch_retinaface.

SnowRipple avatar SnowRipple commented on May 22, 2024

I think I had the same error, the problem was with onnx not pytorch, just updated onnx (pytorch can have different onnx version) ;)

from pytorch_retinaface.

SnowRipple avatar SnowRipple commented on May 22, 2024

Yes, but it was a while ago so I don't remember specifics - it is known problem with onnx, but there was simple fix - try google;)

from pytorch_retinaface.

121649982 avatar 121649982 commented on May 22, 2024

can you tell me how to load .onnx model with tensor RT , thank you very much.

I load the model like this :
std::string dataDirs = "E:/gc/Pytorch_Retinaface-master";
std::vectorstd::string dir;
dir.push_back(dataDirs);
auto parsed = parser->parseFromFile(
locateFile("FaceDetector.onnx", dir).c_str(), static_cast(gLogger.getReportableSeverity()));
if (!parsed)
{
return false;
}

but,I get this errors:

sorRT does not natively support INT64. Attempting to cast down to INT32.
[01/07/2020-19:19:10] [W] [TRT] onnx2trt_utils.cpp:198: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[01/07/2020-19:19:10] [W] [TRT] onnx2trt_utils.cpp:198: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[01/07/2020-19:19:10] [W] [TRT] onnx2trt_utils.cpp:198: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[01/07/2020-19:19:10] [W] [TRT] onnx2trt_utils.cpp:198: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[01/07/2020-19:19:10] [W] [TRT] onnx2trt_utils.cpp:198: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[01/07/2020-19:19:11] [W] [TRT] onnx2trt_utils.cpp:198: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[01/07/2020-19:19:11] [W] [TRT] onnx2trt_utils.cpp:198: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
While parsing node number 106 [Upsample]:
ERROR: builtin_op_importers.cpp:3240 In function importUpsample:
[8] Assertion failed: scales_input.is_weights()

from pytorch_retinaface.

xsacha avatar xsacha commented on May 22, 2024

I think torch2trt is better than going pytorch -> onnx -> tensorrt

from pytorch_retinaface.

zzxaijs avatar zzxaijs commented on May 22, 2024

[01/07 / 2020-19:19:11] [W] [TRT] onnx2trt_utils.cpp:198:您的ONNX模型是使用INT64权重生成的,而TensorRT本身不支持INT64。尝试转换为INT32。
解析节点号106 [Upsample]时:
错误:builtin_op_importers.cpp:3240在函数importUpsample中:
[8]断言失败:scales_input.is_weights(),同样的这个错怎么解决

from pytorch_retinaface.

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.