Classification_interactive.ipyn crashes

Hi,

I am trying to follow the tutorial on the DLI course. I am working through the Classification_interactive.ipyn.

Whenever I try to run the 6th cell in the notebook(see attached) more often than not it just hangs up and never finishes executing.

Some other issues I have had with this notebook:

The live camera display gradually becomes slower and slower or is not live at all.

I get an error when I try to run the camera at the beginning of the notebook.

The one time through when everything had worked the best I was able to start collecting images, but after about the 11th image the notebook crashed

I have had a lot of problems with this notebook any suggestions?

It is a Jetson nano 2GB.

Problem_Cell.txt (1.4 KB)

In the training video - Dana creates a 4 GB swap for the 2GB unit - did you do that? After running for a few days I have seen out of memory messages in terminal running ‘dmesg’ - so I went and did the 4GB swap.

I also found more memory by not running the gui - since its really all done via the Jupyter notebook:

To disable GUI on boot, run:
sudo systemctl set-default multi-user.target

To enable GUI again issue the command:
sudo systemctl set-default graphical.target

I have found heat messages when running ‘dmesg’ in the terminal - - reaching 186f - I just added a fan recently. Do you have a fan?

I tried to increase the swap by using the commands shown in the course, however when I try to append the fstab file I get a permission denied error. I don’t know how to get around that.

I don’t have a fan. I have tried it with the GUI disabled with the same result.

File “/usr/local/lib/python3.6/dist-packages/keras_preprocessing/image/iterator.py”, line 230, in _get_batches_of_transformed_samples
interpolation=self.interpolation)
File “/home/vpraveen/.cache/dazel/_dazel_vpraveen/216c8b41e526c3295d3b802489ac2034/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/makenet/utils/preprocess_crop.py”, line 68, in load_and_crop_img
File “/usr/local/lib/python3.6/dist-packages/keras_preprocessing/image/utils.py”, line 114, in load_img
img = pil_image.open(io.BytesIO(f.read()))
File “/usr/local/lib/python3.6/dist-packages/PIL/Image.py”, line 2818, in open
raise IOError(“cannot identify image file %r” % (filename if filename else fp))
OSError: cannot identify image file <_io.BytesIO object at 0x7fd118243fc0>
Traceback (most recent call last):
File “/usr/local/bin/classification”, line 8, in
sys.exit(main())

please help me

@huchchareddi121 , are you doing the same example in the DLI Tutorial - as being discussed in this thread?
Can you share full details of your environment and the command you ran which caused these error

Hi,

I just bought a second Jetson Nano. This one is a 4GB one. I thought that I was having memory issues, but I am having basically the same issue as before with the 2GB.

I am not trying to do anything that is different from what is in the tutorial.

I have been working on this for months on and off when I have time, but I have not been able to get the basic tutorial going!!

Is there someone out there that can take the time to work with me? I have been reading a lot about AI, and it really looks interesting, but I don’t know how I am going to make any progress if I can’t get the basic examples to work.

Moving this topic to the Jetson Nano forum.

You need to edit /etc/fstab with sudo - i.e. sudo nano /etc/fstab or sudo vi /etc/fstab

Also remember to disable ZRAM as shown here:
https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-transfer-learning.md#mounting-swap

Does the camera notebook work for you, or is your issue only with the classification notebook? If you are using MIPI CSI camera, I recommend to try a USB camera like Logitech C920 or C270.

You may also try this tutorial which doesn’t rely on Jupyter: https://github.com/dusty-nv/jetson-inference

Camera issue:

The camera works just fine with the “hello camera” notebook.

Memory issue:
Here are the commands I am running this is a direct copy and paste off of the Introduction and setup from the “Getting started with AI on Jetson nano”

Does the course have commands that are incorrect then?

# Disable ZRAM:
sudo systemctl disable nvzramconfig

# Create 4GB swap file
sudo fallocate -l 4G /mnt/4GB.swap
sudo chmod 600 /mnt/4GB.swap
sudo mkswap /mnt/4GB.swap

# Append the following line to /etc/fstab
sudo echo "/mnt/4GB.swap swap swap defaults 0 0" >> /etc/fstab

This should work - are you sure you ran it with sudo? If still not working, try editing /etc/fstab directly with sudo nano /etc/fstab or sudo vi /etc/fstab and add that line to the end.

I have tried same thing didn’t work for me

I ran: sudo echo “/mnt/4GB.swap swap swap defaults 0 0” >> /etc/fstab
I copied and pasted just to make sure that I got the “sudo” in, but I still got: bash: /etc/fstab: Permission denied

I also ran: sudo nano /etc/fstab
I got:sudo: nano: command not found

I am not familiar with vi, but that did open up the text editor. I guess I will have learn vi before proceeding. I will work on that today, and report back when I have that complete.

Ah ok - you can also just run sudo apt-get update && sudo apt-get install nano. Not to start an editor war here, but the nano text editor is easier to use than vi/vim. If you had a display attached and were running the desktop, you could also run sudo gedit /etc/fstab and it would open it in the GUI text editor.

Thanks! I ended up using gedit. It worked great! I am working through the tutorial now. It has been training for about an hour for 1 epoch. swap usage has grown to 76% 4.7 Gigabytes. Is this normal?

It’s normal to have some swap usage but IIRC that sounds a bit higher than normal. To save memory, have you disabled the X-server from starting with these commands?

https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-transfer-learning.md#disabling-the-desktop-gui

Since you mentioned using GEdit, it sounds like you currently have display attached. It’s recommended to run it with the desktop disabled to reduce the memory usage on Nano 2GB. You can view the Jupyter notebook remotely from a laptop/PC.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.