Open tomgit-com opened 2 years ago
Hello, I am using ubuntu and I run to the same error
I have found a temporary workaround.
If you change in line 29
output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
to (removing the typechange from list to value)
output_layers = [layer_names[i - 1] for i in net.getUnconnectedOutLayers()]
in the object_detection.py script (you'll find the location in the error message) it should work again.
Small edit: I've forked the library and added the fix there. Feel free to add it to the main project, I'll remove the fork later =)
Besides the change mentioned by @tomgit-com I also had to comment out i = i[0]
on line 245:
https://github.com/arunponnusamy/cvlib/blob/52a31866f17270d55079b0ab7d56c44c601c79a1/cvlib/object_detection.py#L245
for i in indices:
#i = i[0]
box = boxes[i]
I've also noticed that issues, but it happened rather lately. I don't know if there've been some changes on the pretrained models
I think there are some changes in the latest OpenCV version. Try using with older opencv version for now. Will fix this soon.
with openCV 4.5.3.56 works, But with 4.5.4.58, 4.5.4.60(latest) doesn't work.
Hello, this issue still exists, I ran into it today. I followed tomgit-com and mihaipanait's comments and it worked. Thank you for the direction.
As of rather recently I am unable to use object_detection, whereas everything else seems to work rather fine. It boils down to that error message:
It runs fine on my old Win10/11 installation from a couple of months ago, however accessing the same script from a WSL machine on the exact same PC results in the error above. I'm also getting the same from a new macOS setup.