# Classification\_interactive.ipyn crashes

**URL:** <https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126>\
**Category:** Jetson Nano\
**Tags:** deep-learning\
**Created:** [July 8, 2021, 2:11pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126 "2021-07-08T14:11:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![pettinger.michael](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pettinger.michael](https://forums.developer.nvidia.com/u/pettinger.michael)\
**Post date:** [July 8, 2021, 2:12pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/1 "2021-07-08T14:12:00Z")

</div>

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](https://forums.developer.nvidia.com/uploads/short-url/wZVpvvzgXbM0M4sPCm8vLdFjQcw.txt) (1.4 KB)

---

<div class="post-metadata">

**Author:** ![johnmpeterson](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@johnmpeterson](https://forums.developer.nvidia.com/u/johnmpeterson)\
**Post date:** [July 15, 2021, 6:01pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/2 "2021-07-15T18:01:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pettinger.michael](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pettinger.michael](https://forums.developer.nvidia.com/u/pettinger.michael)\
**Post date:** [July 15, 2021, 7:20pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/3 "2021-07-15T19:20:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![huchchareddi121](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@huchchareddi121](https://forums.developer.nvidia.com/u/huchchareddi121)\
**Post date:** [July 17, 2021, 9:47am UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/4 "2021-07-17T09:47:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [July 21, 2021, 11:30pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/5 "2021-07-21T23:30:53Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![pettinger.michael](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pettinger.michael](https://forums.developer.nvidia.com/u/pettinger.michael)\
**Post date:** [August 3, 2021, 11:32pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/6 "2021-08-03T23:32:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [August 4, 2021, 2:52pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/7 "2021-08-04T14:52:33Z")

</div>

Moving this topic to the Jetson Nano forum.

> [@pettinger.michael](#):
>
> 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.

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](https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-transfer-learning.md#mounting-swap)

> [@pettinger.michael](#):
>
> 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.

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](https://github.com/dusty-nv/jetson-inference)

---

<div class="post-metadata">

**Author:** ![pettinger.michael](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pettinger.michael](https://forums.developer.nvidia.com/u/pettinger.michael)\
**Post date:** [August 4, 2021, 3:04pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/8 "2021-08-04T15:04:34Z")

</div>

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?**

```auto
# 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

```

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [August 4, 2021, 4:46pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/9 "2021-08-04T16:46:32Z")

</div>

> [@pettinger.michael](#):
>
> `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.

---

<div class="post-metadata">

**Author:** ![huchchareddi121](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@huchchareddi121](https://forums.developer.nvidia.com/u/huchchareddi121)\
**Post date:** [August 5, 2021, 7:01am UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/10 "2021-08-05T07:01:48Z")

</div>

I have tried same thing didn’t work for me

---

<div class="post-metadata">

**Author:** ![pettinger.michael](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pettinger.michael](https://forums.developer.nvidia.com/u/pettinger.michael)\
**Post date:** [August 5, 2021, 1:29pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/11 "2021-08-05T13:29:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [August 5, 2021, 3:04pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/12 "2021-08-05T15:04:04Z")

</div>

> [@pettinger.michael](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![pettinger.michael](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pettinger.michael](https://forums.developer.nvidia.com/u/pettinger.michael)\
**Post date:** [August 5, 2021, 3:12pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/13 "2021-08-05T15:12:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [August 5, 2021, 3:16pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/14 "2021-08-05T15:16:34Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [October 4, 2021, 3:16pm UTC](https://forums.developer.nvidia.com/t/classification-interactive-ipyn-crashes/183126/15 "2021-10-04T15:16:37Z")

</div>

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