Giter Club home page Giter Club logo

Comments (6)

hxcai avatar hxcai commented on May 18, 2024

@wwdok We haven't tried it. You can use our tool to try.

from volksdep.

wwdok avatar wwdok commented on May 18, 2024

I have just tried it out, but it reports error:

(base) weidawang@weidawang-TUF-Gaming-FX506LU-FX506LU:~/Repo/mmaction2/tools$ python onnx2tensorrt.py
In node -1 (importIf): UNSUPPORTED_NODE: Assertion failed: cond.is_weights() && cond.weights().count() == 1 && "If condition must be a initializer!"
[TensorRT] ERROR: Network must have at least one output
[TensorRT] ERROR: Network validation failed.
Traceback (most recent call last):
  File "onnx2tensorrt.py", line 10, in <module>
    trt_model = onnx2trt(model)
  File "/home/weidawang/miniconda3/lib/python3.7/site-packages/volksdep/converters/onnx2trt.py", line 119, in onnx2trt
    trt_model = TRTModel(engine)
  File "/home/weidawang/miniconda3/lib/python3.7/site-packages/volksdep/converters/base.py", line 50, in __init__
    self.context = self.engine.create_execution_context()
AttributeError: 'NoneType' object has no attribute 'create_execution_context'

from volksdep.

hxcai avatar hxcai commented on May 18, 2024

@wwdok Here is unsupported operation in onnx model, maybe you can try to use higher opset_version in torch2onnx to convert pytorch model to onnx, and then use onnx2trt to convert onnx to tensorrt engine.

from volksdep.

wwdok avatar wwdok commented on May 18, 2024

Yes, the unsupported operation in onnx model is if, i found a solution here, and solved it by using torch 1.5 to export the onnx model, and now the tensorrt model also is successfully exported. In the meantime, i convert the onnx model by trtexec, i found the .engine file size exported by volksdep(101.6MB ) and trtexec(122.6MB) are different, so I am curious what are the differences inside, could you please tell me ?

from volksdep.

hxcai avatar hxcai commented on May 18, 2024

@wwdok Please make sure that the two engine files are generated in the same environment and with same params like platform, os, cuda version, tensorrt version, fp mode, work_spacesize and etc.. Also, trtexec is implement with c++ api and ours is implemented with python api, this may make different.

from volksdep.

wwdok avatar wwdok commented on May 18, 2024

Yes, they are converted on the same environment, for fp mode i didn't set, i just use default( for volksdep is fp32 ). Thansk for your reply, i think i need more time to get familiar with tensorrt ~

from volksdep.

Related Issues (15)

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.