Hello,
I use a YOLOv5 C++ implementation based on OpenCV 4.6.0.
On CPU it runs without any issue, but when I switch to CUDA I get this error:
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.6.0-dev) /home/username/Desktop/Projects/opencv/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:43: error: (-215:Assertion failed) is_shape_same(dest, src) in function 'copy'
The error occurs at the line of code:
net.forward(outputs, net.getUnconnectedOutLayersNames());
I ran a sample with CUDA to verify the cmake installation, and it works fine on both CPU and GPU.
The YOLOv5 C++ implementation used is here.
Any suggestions/ideas are very much appreciated for why on CPU it works fine but when I run on GPU, the data copied between the src and dest tensors doesn’t have the same shape anymore.