Comments (6)
@wwdok We haven't tried it. You can use our tool to try.
from volksdep.
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.
@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.
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.
@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.
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)
- Support LTSM or GRU op?
- RuntimeError: ONNX export failed: Couldn't export Python operator DeformConvFunction HOT 3
- AttributeError: 'NoneType' object has no attribute 'create_execution_context' HOT 3
- about dummy_input
- AttributeError: 'NoneType' object has no attribute 'create_execytion_context' HOT 2
- ERROR: No matching distribution found for tensorrt>=7.1.0.* HOT 2
- AttributeError: 'NoneType' object has no attribute 'create_execution_context'
- Installation error HOT 3
- is ReformatFreeIO supported? HOT 2
- RuntimeError: ONNX export failed: Couldn't export operator aten::upsample_bilinear2d
- Error HOT 1
- Warning: ATen was a removed experimental ops. In the future, we may directly reject this operator. Please update your model as soon as possible. HOT 1
- Is Bert Supported?
- [TensorRT] ERROR: Parameter check failed at: engine.cpp::setBindingDimensions::1045, condition: profileMinDims.d[i] <= dimensions.d[i] HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from volksdep.