I tried to use yolov5 on my raspberry pi for image detection. But whenever I tried using the raspberry pi camera this error message popped up with 'AssertionError: 1/1: 0... Failed to open 0'

I am using

ubuntu 22.04

Raspberry Pi 4 (4 GB RAM)

Raspberry pi camera module v2 error screenshot

1 Answer 1


It looks like opencv has some problem to open your webcam. From the tutorial on PyTorch's website, they have some configuration on "/boot/config.txt". Have you completed this step?

Another way to see which media devices available on your system, you can check with;

v4l2-ctl --list-devices

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.