Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with yolo-v3(416*416) #1

Open
joinany opened this issue Apr 21, 2019 · 4 comments
Open

Error with yolo-v3(416*416) #1

joinany opened this issue Apr 21, 2019 · 4 comments

Comments

@joinany
Copy link

joinany commented Apr 21, 2019

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)

@joinany
Copy link
Author

joinany commented Apr 21, 2019

I found that the filters of 255 should be changed to 18 in my case. Thanks.

@Hanlos
Copy link

Hanlos commented Jul 25, 2019

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)

you must generate yolov3-416.onnx by change the cfg file and yolov3_to_onnx.py file ,the height and width and the out shape 19,38,76 to 13,26,52, I change this, and success!

@JWSunny
Copy link

JWSunny commented Jul 31, 2019

@Hanlos hello, thanks for you sharing, but how can i change the yolov3_to_onnx.py file? can you provide guidance, thanks.

@liguoyu666
Copy link

liguoyu666 commented May 22, 2020

I found that the filters of 255 should be changed to 18 in my case. Thanks.

Hello,I have a similar problem when I convert my weight, I changed the cfg and trt_yolo3_module_1batch.py

`[convolutional]
size=1
stride=1
pad=1
filters=21
activation=linear

[yolo]
mask = 3,4,5
anchors = 15,17, 23,26, 30,34, 37,43, 47,52, 66,75, 97,109, 196,233, 576,713
classes=2
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1`

self.num_classes = 2 in trt_yolo3_module_1batch.py

Traceback (most recent call last): File "/home/lgy/PycharmProjects/TensorRT_yolo3_module/trt_yolo3_module_1batch.py", line 216, in <module> output_dic_list = alpha_yolo3_unit.process_frame_batch(input_dic_list) File "/home/lgy/PycharmProjects/TensorRT_yolo3_module/trt_yolo3_module_1batch.py", line 187, in process_frame_batch (class_list_all,box_list_all,conf_list_all) = self.detection(procession_tuple) File "/home/lgy/PycharmProjects/TensorRT_yolo3_module/trt_yolo3_module_1batch.py", line 101, in detection output = output.reshape(shape) ValueError: cannot reshape array of size 3549 into shape (1,255,13,13)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants