cw-zero / tensorrt_yolo3_module Goto Github PK
View Code? Open in Web Editor NEWYou can import this module directly
You can import this module directly
我尝试了onnx版本为1.2.0可以成功转换onnx模型,但是我使用tensorrt7.0无法转换,我觉得可能是tensorrt版本的问题,另外我想将转后trt模型保存为engine,您有什么好的建议吗?还是我只需要修改保存文件名后缀即可
剪枝模型项目地址:https://github.com/Lam1360/YOLOv3-model-pruning
我最近一直在尝试用tensorrt加速yolo的剪枝,但是总是失败,所以想问问你,这个代码支不支持剪枝的yolo的操作
using weight_to_onnx.py to transfer model to onnx by running to onnx.checker.check_model(yolov3_model_def)
, it raise error as below:
onnx.onnx_cpp2py_export.checker.ValidationError: Op registered for Upsample is deprecated in domain_version of 11
==> Context: Bad node spec: input: "085_convolutional_lrelu" output: "086_upsample" name: "086_upsample" op_type: "Upsample" attribute { name: "mode" s: "nearest" type: STRING } attribute { name: "scales" floats: 1 floats: 1 floats: 2 floats: 2 type: FLOATS }
do you have any suggestion on this? my onnx version is too new?
my onnx version is 1.6.1...
onnx.onnx_cpp2py_export.checker.ValidationError: Node (086_upsample) has input size 1 not in range [min=2, max=2].
Did you test the project with yolo-v3(416*416)?
$ python3 trt_yolo3_module_1batch.py
Reading engine from file yolov3-608.trt
Traceback (most recent call last):
File "trt_yolo3_module_1batch.py", line 214, in
output_dic_list = alpha_yolo3_unit.process_frame_batch(input_dic_list)
File "trt_yolo3_module_1batch.py", line 185, in process_frame_batch
(class_list_all,box_list_all,conf_list_all) = self.detection(procession_tuple)
File "trt_yolo3_module_1batch.py", line 99, in detection
output = output.reshape(shape)
ValueError: cannot reshape array of size 3042 into shape (1,255,13,13)
Hi @Cw-zero, in [trt_yolo3_module_multibatch.py][line:150] you mentioned static class name 'Person'. It should be dynamically aligned like-wise yolo. right? If so, how can we?
for b in boxes_k: x1=int(b[0]) x2=int(b[2]) y1=int(b[1]) y2=int(b[3]) box_list.append([x1,x2,y1,y2]) class_list.append('person')
Can you share your TensorRT&onnx&pytorch version?
When I run, I encounter the following errors,I suspect that different versions resulted.
onnx 1.5
Tensorrt TensorRT-5.1.5.0
Traceback (most recent call last):
File "weight_to_onnx.py", line 670, in
main()
File "weight_to_onnx.py", line 663, in main
onnx.checker.check_model(yolov3_model_def)
File "/home/zcc/anaconda3/envs/py27/lib/python2.7/site-packages/onnx/checker.py", line 86, in check_model
C.check_model(model.SerializeToString())
onnx.onnx_cpp2py_export.checker.ValidationError: Op registered for Upsample is depracted in domain_version of 10
I use the weight_to_onnx.py from nvidia tensorrt sdk to convert yolov3.weights on Ubuntu system,and then use the converted yolov3.onnx file on Windows system,but the windows trt sdk module report parse the onnx file fail,so is it means that the converted onnx file is only used on linux,can not be used on windows?
Thanks for sharing,
could tell me how to run on camera? thank you
who can explain the "TensorRT inference time" and "After process time" for me?why it cost so much time?THANKS,and looking for your replay.
/home/broliao/图片/2019-12-10 11-57-57 的屏幕截图.png
In file trt_yolo3_module_1batch.py:
Ln 49 a = torch.cuda.FloatTensor() #pytorch必须首先占用部分CUDA
Why need pytorch first?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.