I’ve having trouble running the docker for the “Getting Started with AI on Jetson Nano (V2)”. I’m following the instructions, and so far everything works until I try to run the conatiner.
In my case, I want to run it with the CSI camera, so this is the script I run:
What’s confusing is that in the course, it points the website to address what tag you should use. The correct tags are actually found in the examples found in the course, not the docker site.
Hi - I had all sorts of problems getting my picam 2.1 to work (noob)
I used an amalgamation of icornejo.a’s code and the v2.0.0-r32.4.3 tag. I believe there should be a backslash after the –volume /tmp/argus_socket:/tmp/argus_socket line so the code that worked for me was:
I just tried and that worked. Honestly, I gave up after the CSI issue as well. I was pulling out my hair figuring out what was wrong with connecting, and then being disapointed that the camera wasn’t working inside the container was defalting.
I just tried it again with your code, it works!
Thanks man, I think this is really going to help those of us using the CSI cam.
Can you help a noob? Thank you for the clarification. I tried your --volume addition after many days of running:
from jetcam.usb_camera import USBCamera #TODO change capture_device if incorrect for your system
camera = USBCamera(width=224, height=224, capture_width=640, capture_height=480, capture_device=0)
Error messages are:
RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/usb_camera.py in init(self, *args, **kwargs)
23 if not re:
—> 24 raise RuntimeError(‘Could not read image from camera.’)
25
RuntimeError: Could not read image from camera.
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
in
2
3 #TODO change capture_device if incorrect for your system
----> 4 camera = USBCamera(width=224, height=224, capture_width=640, capture_height=480, capture_device=0)
/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/usb_camera.py in init(self, *args, **kwargs)
26 except:
27 raise RuntimeError(
—> 28 ‘Could not initialize camera. Please see error trace.’)
29
30 atexit.register(self.cap.release)
RuntimeError: Could not initialize camera. Please see error trace.
Continuation of comment 10:
from jetcam.usb_camera import USBCamera
#TODO change capture_device if incorrect for your system
camera = USBCamera(width=224, height=224, capture_width=640, capture_height=480, capture_device=0)
RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/usb_camera.py in init(self, *args, **kwargs)
23 if not re:
—> 24 raise RuntimeError(‘Could not read image from camera.’)
25
RuntimeError: Could not read image from camera.
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
in
2
3 #TODO change capture_device if incorrect for your system
----> 4 camera = USBCamera(width=224, height=224, capture_width=640, capture_height=480, capture_device=0)
/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/usb_camera.py in init(self, *args, **kwargs)
26 except:
27 raise RuntimeError(
—> 28 ‘Could not initialize camera. Please see error trace.’)
29
30 atexit.register(self.cap.release)
RuntimeError: Could not initialize camera. Please see error trace.
[Note: after Kernel Shut Down, in a separate/new session, I ran “argus_socket" string in csi_camera.ipynb. Essentially same error message as above (for /csi_camera.py]
Not sure how to launch my Docker container with --device /dev/video1
When I run the query line: !ls -ltrh /dev/video*
The response I get is: crw-rw---- 1 root video 81, 0 Oct 21 22:56 /dev/video0
How do I change my Docker container line in my notebook to --device /dev/video1
This command you use to launch the container, it is not in one of the notebooks.
When you run the query line inside of the notebook, you should then see /dev/video1 show up also. Then remember to change capture_device=1 in the notebook cell.
Ok, hmm - if you run ls /dev/video* from the host device (outside of container), does it show /dev/video1? What devices are listed?
Have you been able to confirm that you can view your USB webcam outside of the container, from an application like Cheese or similar? What USB webcam do you have?
I am currently using a Mac as Host (not a pc, so not using Cheese, so far).
As expected, outside the Docker container in Host terminal session without secure shell into the NVIDIA Jetbot, /dev/video0 and /dev/video1 do not show up in the Host. Within secure shell, both appear. See terminal session:
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the ‘unminimize’ command.
286 packages can be updated.
194 updates are security updates.
Last login: Fri Oct 23 13:37:40 2020 from 192.168.55.100
vern@vern4:~$ ls /dev/video*
/dev/video0 /dev/video1
Also, my USB camera is a Logitech C-910 Carl Zeiss Teaser. When it is plugged directly into my Mac USB 3.1 bus, I can see it listed in my system report and view its image in FaceTime.
When the USB camera is plugged into “Linux for Tegra” (NVIDIA), the “Linux for Tegra” device is listed in USB 3.1 Bus. However,I cannot see/gain access to this Logitech USB camera image in FaceTime while is ssh mode.
OK, can you try running this command from the Jetson to launch the container again?
Then once the container is launched, run ls /dev/video* from the container - outside of JupyterLab. Just run it from the container’s shell.
I wonder if when you tried this before if something was amiss, because you ran it with --device /dev/video1, but /dev/video0 showed up in the container even though you didn’t map that… so probably worth try it again. Make sure you container is exited first before relaunching with the command above.
crw-rw---- 1 root video 81, 4 Oct 23 20:44 /dev/video1
crw-rw---- 1 root video 81, 0 Oct 23 20:44 /dev/video0
However, I don’t understand the last line of your response, "Make sure you container is exited first before relaunching with the command above.” Does that exiting result from closing the terminal ssh session before executing the command (below) in Juypter? Or, is it this done by Shut Down Kernel?
I have found a specific problem. My from string/command cannot access USBCamera in the location /var/mail/…
So, Last login: Sun Oct 25 15:24:06 2020, both video0 and video1 show in the list:
$ !ls -ltrh /dev/video*
crw-rw---- 1 root video 81, 4 Oct 25 19:31 /dev/video1
crw-rw---- 1 root video 81, 0 Oct 25 19:31 /dev/video0
When I then run:
$ from jetcam.usb_camera import USBCamera
When I search the file: /var/mail, there is no content in that file, and no jetcam.usb_camera in /var/lib. So, there are no files in the called address.
I’ve looked through the other /var subfiles and cannot find jetcam.usb_camera, or USBCamera
Where is the USBCamera file/script? And how do I access it?