Comments (10)
I passed 'strict=False'
model = load_state_dict(path, strict=False)
from clrnet-onnxruntime-and-tensorrt-demo.
You did not successfully replace the clr_head.py file.
cp clr_head.py in this code to CLRNet/clrnet/models/heads/ in official code.
from clrnet-onnxruntime-and-tensorrt-demo.
Thanks @xuanandsix.
It seems to be the clr_head.py from this repo is being indeed loaded.
I am trying to debug now - then why I still get this crash, as you say I should not.
Meanwhile if you have more thoughts, let us know here.
from clrnet-onnxruntime-and-tensorrt-demo.
1、By 'pip list' check if the path to the 'clrnet' package is correct.
2、Or choose to replace the clr_head.py file first before running package install (i.e. 'python setup.py build develop').
If you need training source code, it is recommended to maintain training and deployment with two environments.
A log has been upload here https://github.com/xuanandsix/CLRNet-onnxruntime-and-tensorrt-demo/blob/main/my_log/test_onnx.log
My deployment process from scratch. You can view each step by search: ***@ai02
from clrnet-onnxruntime-and-tensorrt-demo.
Hi @xuanandsix, I notice:
In your example "python torch2onnx.py configs/clrnet/clr_resnet18_tusimple.py --load_from tusimple_r18.pth",
when I print the keys in "state_dict" from "https://github.com/xuanandsix/CLRNet-onnxruntime-and-tensorrt-demo/blob/main/torch2onnx.py#L22",
I do not see these:-
module.heads.sample_x_indexs
module.heads.prior_feat_ys
module.heads.prior_ys
module.heads.criterion.weight
But I have these when I load my trained model.
So maybe this is why you are not getting my crash that I list in this issue. What do you think?
from clrnet-onnxruntime-and-tensorrt-demo.
@sahamitul Have you solved this problem?
from clrnet-onnxruntime-and-tensorrt-demo.
same issues,any advices?
from clrnet-onnxruntime-and-tensorrt-demo.
@mengxia1994 maybe you can try other backbone. I met this problem when use resnet-18, but it worked when I use dla 34.
from clrnet-onnxruntime-and-tensorrt-demo.
I found that exporting seems to work ok if I use the pretraining weights provided by https://github.com/Turoad/clrnet but if I train my own network, I get this error, with both dla34-culane and resnet18-tusimple. Not sure what's different
from clrnet-onnxruntime-and-tensorrt-demo.
OK I got this working literally just by deleting the offending dict keys:
del new_state_dict["heads.sample_x_indexs"]
del new_state_dict["heads.prior_feat_ys"]
del new_state_dict["heads.prior_ys"]
del new_state_dict["heads.criterion.weight
inserted just before
Edit. probably better to do as @AshwinAKannan suggests with strict=False
net.load_state_dict(new_state_dict, strict=False)
from clrnet-onnxruntime-and-tensorrt-demo.
Related Issues (13)
- RuntimeError: Exporting the operator grid_sampler to ONNX opset version 11 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub. HOT 4
- ONNX inference time is about 5 times slower than pytorch model inference
- C++ reference
- processing onnx Error
- Can you provide Culane_r18.onnx file,thanks
- c++ HOT 1
- how to install trtexec HOT 1
- [optimizer.cpp::computeCosts::2011] Error Code 10: Internal Error (Could not find any implementation for node {ForeignNode[538...Reshape_295]}.)
- onnx inference time better than tensorrt inference time HOT 1
- Can you provide tusimple_r18.onnx file,thanks HOT 3
- Why different Softmax?
- An error occurred during demo_trt 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 clrnet-onnxruntime-and-tensorrt-demo.