我已经在colab上训练了yolo-tiny v4,检测在colab上工作得很好。然后我尝试在集成了Gazebo/ROS的visual studio上以这种方式加载yolo- in v4:

未出现错误,但检测失败(未检测到对象,检测的输出是Nan的向量)。我在visual studio中使用的是OpenCV版本: 4.2.0和Python2.7.17。
有什么想法吗?
发布于 2020-12-04 22:22:03
尝试从源代码编译OpenCV >= v4.5.0。
从源代码编译4.5.0版本为我在Python3中解决了这个问题,我检查了它在Python2.7中也可以工作。
我最初在Raspberry Pi 4和Windows7上的Yolo Tiny v4和Python3.7上都遇到了同样的问题,OpenCV是通过pip install opencv-contrib-python安装的(Python2.7似乎不可用?)。我迭代地尝试了不同的版本,从pip获得或从源代码重新编译(在Raspbian上通过pip获得的最新版本是4.1.0.25):
opencv-contrib-python==3.4.10.37 no detections (tested on Windows)
opencv-contrib-python==4.1.0.25: no detections (tested on Rasbian Buster and Windows)
opencv-contrib-python==4.2.0.34: no detections (tested on Windows)
opencv-contrib-python==4.3.0.38: no detections (tested on Windows)
opencv 4.4.0 compiled from sources: no detections (tested on Rasbian Buster)
opencv-contrib-python==4.4.0.40: ok (tested on Windows)
opencv-contrib-python==4.4.0.46: ok (testd on Windows)
opencv 4.5.0 compiled from sources: ok (tested on Rasbian Buster)opencv-contrib-python==4.4.0.40之后的版本似乎可以工作,所以Raspbian上的“下一个”版本是v4.5.0。
https://stackoverflow.com/questions/63720915
复制相似问题