Camera freezes in Image Classification

Hello, I am currently doing the Jetson AI Fundamentals course with the Jetson Nano 2GB developer kit. In the image classification project, the camera output works fine if adding images to data but it freezes whenever I try to change the state, train or evaluate. I am using a Waveshare IMX219-160IR camera. I am new to this and would appreciate any help.

hello peterygx,

please refer to developer guide,
please verify the basic camera functionality with the sample pipelines in Approaches for Validating and Testing the V4L2 Driver session.

Does the camera un-freeze after training, or is it perpetually frozen thereafter? One suggestion might be to stop the camera streaming before training, and then re-start it after.

If you have a USB webcam, you might also want to try that - they use a different backend/driver than the CSI cameras do.

Yes it is perpetually frozen thereafter. The camera stream starts to lag and eventually freezes when I press the stop state. Nothing happens when I press the live state button. Is there some other way to stop and start the camera?

I will check in to see if you can simply use the GUI to stop/start the camera or if you need to run a cell.

In the meantime, can you check the memory and SWAP usage by running sudo tegrastats outside of the container? How much total SWAP capacity is reported to be present?

I have 5086MB for total swap memory.

Hmm ok, your swap memory looks good. You might want to try a USB webcam (like Logitech C270, C920, or similar) while we look into this further. We have tested this on Nano 2GB and the Raspberry Pi Camera Module v2 (which is also IMX219 sensor like the Waveshare). I’m not sure if the Waveshare is using a different driver or something that is behaving differently.

So I was following this post Rpi v2 CSI camera freezes with Jetson Nano 2GB and it works now.

Steps are as follows:

  1. I reflashed the image.
  2. I made an additional 8GB swap space.(I didn’t know how to edit or remove the one made in the initial setup so I have a total of 12GB swap now)
  3. added --memory=500M --memory-swap=8G to the docker run script.

Thanks @dusty_nv and @juliefaurelacroix

1 Like

You’re welcome! I tried it again this morning just to confirm that everything worked and I’ve written a more detailed solution here. Cheers!