Lesson1 Issues with Gradient Instance

The title says it all, however I have run into multiple problems using the Gradient Instance so far and I wanted to see if the problems were unique to me. I chose the Gradient Instance initially as I read that FastAI would work more smoothly on it compared to a Collab notebook.

So far I have two major issues: the first is the initial model training

# CLICK ME
from fastai.vision.all import *
path = untar_data(URLs.PETS)/'images'

def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
    path, get_image_files(path), valid_pct=0.2, seed=42,
    label_func=is_cat, item_tfms=Resize(224))

learn = cnn_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)

Where the output I get is an issue with DataLoader:
RuntimeError: DataLoader worker (pid 1220) is killed by signal: Killed.

A previous post covered that issue by suggesting using the argument num_workers=0, however running with that simply made my kernel shutdown which is why I am wondering if this is unique to Gradient on Paperspace.

Secondly, I chose Collab largely because I heard it didn’t support widgets. That being said when I tried to run the code cell for a simple upload button:
uploader = widgets.FileUpload()
uploader

I got a response that “widgets could not be found”. As someone who recently started with FastAI should I switch over to another notebook provider? Should I just skip ahead? Looking forward to any comments.

Hey,

That’s a weird error indeed. Are you sure your instance has enough RAM and GPU RAM to run the code? Otherwise it’s possible that the kernel is dying because of lack of resources. Which instance are you using?

About Colab - you should check the Colab thread in the forum, I believe people have already found workarounds for the widgets.

1 Like

Hi @robmel – Tom from Paperspace here. Are you launching your notebook on a GPU backed instance? The fastai course requires a GPU so if you’re utilizing our free option that means you must choose either a Free-GPU or Free-P5000 but no the Free-CPU instance.

1 Like

@tomg I set up a free GPU instance and used it for a little while only to find it then changed to a CPU-only instance. This has happened twice now. The only solution I’ve found is to delete the CPU instance and start from scratch with a new free-GPU instance, losing any of my previous changes.

Is this expected behaviour or is something going wrong?

1 Like

Hey Tom, sorry for the late reply I got absolutely swamped with work and only found time recently to get back into it. Yes it indeed seems that Free-CPU seems to be the problem, however like @thawkins mentioned, I originally set up a Free-P5000 so it seems strange about the switch, will delete and swap over and report what I find.

Hi. I set a notebook on a free GPU but sometimes I see that it is on cpu. What should I do with this sudden automatic change?

Hi @Fahimeh – this is not possible. Even with our free notebooks you always launch on the instance type you select. Sometimes the free tier fills up due to GPU demand and when this does happen you won’t be able to select a GPU but our launcher will never launch on CPU when a GPU is selected.

Hope this helps – should you experience abnormal behavior to the above please file a support ticket so that we may look deeper into this.

Exact same problem… Very dissapointing. I have had to do this everyday now. :frowning: and you loose all the changes made in the other notebooks as you have to delete them.

1 Like

Exact same issue as @thawkins and @Fahimeh and @robmel . I think what is happening is that when we start we are forced to use only the “Free-CPU” option as there are probably the quota is full.

But what is fishy/wierd is that when I open a new notebook I am able to see the “FREE-GPU” option.

Are others facing this too?

Hi. I could Select GPU as a machin type at first. Some times it isn’t possible but after some hours it will be ok and u can see ’ free GPU’ in the list when you want to creat a new notebook

No the wierd thing is it’s not available in the list, whereas when I create a new notebook I get all sorts of machines available. I have reported it to Paperspace. They have reproduced it and working on helping me. Thanks.

1 Like

I found this thread when looking for the issue I have now with paperspace-gradient. With a Free GPU M4000 I could run the first model in chapter one with uploading the cat and dog files and run epocs.

But when I happily ran for uploading my own cat image, the code couldn’t be executed because “name ‘Widgets’ is not defined”.

And when I tried all the following code sections they all cannot be executed because “name ‘PILImage’ is not defined”, “name 'uploader” is not defined" and therefore no classifier worked for me.

Then followed by these: “name ‘gv’ is not defined” and in the book which I have bought they are all images.

Anyone who can assist? Would be very grateful! And yes, I am not a programmer…

You can save your work on /storage, so you can use it from multiple instances.

I have set up a free GPU notebook for training and a free CPU notebook when I know, I will only do inference, or try things with python and numpy. Both gradient notebooks have access to the same jupyter notebooks in my /storage folder. I hope this helps.
Another solution would be to use a git repository to save your changes to github or gitlab, or whatever you use.

1 Like

Hi @MikaelF, not sure if you figured it out already, but since I found your post first here is the answer:

You have to run the first line where it imports:

Hope this helps

1 Like

Thanks Manuel, it did! Almost painful to understand that I missed out on the first row.