Lesson 1 discussion

I’m getting an error loading the lesson 1 notebook on my t2 server. The error reads:

Unreadable Notebook: /home/ubuntu/nbs/lesson1.ipynb NotJSONError('Notebook does not appear to be JSON: […])

I’ve tried deleting it and repeating the wget but no luck. I’m doing the wget to here:

https://github.com/fastai/courses/blob/master/deeplearning1/nbs/lesson1.ipynb

Any thoughts on why it is unreadable?

Anyone familiar with the css Jeremy is using for this notebooks?

1 Like

Hey @altmbr, it seems that you notebook file is corrupted, I mean, there is weird character breaking JSON format. There are more comments about this issue. In my case, I just used git to download the files.

1 Like

You might want to try downloading the file to your computer. Then you can upload it directly in jupyter. Theres a little ‘upload’ button in jupyter across from the home icon.

3 Likes

@carlosdeep, @Kradoc simple and sweet. Thanks :).

i had this problem maybe this link helps:

I am getting this error.
Cuda error: GpuElemwise node_1a4d88a71be2a74afabcec27cbb0fc5c_0 Sub: out of memory.
n_blocks=30 threads_per_block=256
Call: kernel_Sub_node_1a4d88a71be2a74afabcec27cbb0fc5c_0_Ccontiguous<<<n_blocks, threads_per_block>>>(numEls, local_dims[0], local_dims[1], local_dims[2], i0_data, local_str[0][0], local_str[0][1], local_str[0][2], i1_data, local_str[1][0], local_str[1][1], local_str[1][2], o0_data, local_ostr[0][0], local_ostr[0][1], local_ostr[0][2])

Apply node that caused the error: GpuElemwise{Sub}[(0, 0)](GpuFromHost.0, CudaNdarrayConstant{[[[[ 123.68 ]]

[[ 116.779]]

[[ 103.939]]]]})
Toposort index: 41
Inputs types: [CudaNdarrayType(float32, 4D), CudaNdarrayType(float32, (True, False, True, True))]
Inputs shapes: [(32, 3, 224, 224), (1, 3, 1, 1)]
Inputs strides: [(150528, 50176, 224, 1), (0, 1, 0, 0)]
Inputs values: [‘not shown’, CudaNdarray([[[[ 123.68 ]]

[[ 116.779]]

[[ 103.939]]]])]
Outputs clients: [[GpuSubtensor{::, ::int64}(GpuElemwise{Sub}[(0, 0)].0, Constant{-1})]]

HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. This can be done with by setting the Theano flag ‘optimizer=fast_compile’. If that does not work, Theano optimizations can be disabled with ‘optimizer=None’.
HINT: Use the Theano flag ‘exception_verbosity=high’ for a debugprint and storage map footprint of this apply node.

@altmbr if you wget from git directly on the file it will download the html page being displayed and not the file you want. On the left/top side you have three buttons: Raw Blame History, click on Raw and wget the file you get, in your case it should be:
https://raw.githubusercontent.com/fastai/courses/master/deeplearning1/nbs/lesson1.ipynb

1 Like

@gauravgupta your GPU is running out of memory. Make sure you don’t have any other proccess running: on the bash console, run : nvidia-smi -l 1
to get a monitor of the gpu usage. If no other proccess is running try a smaller batch size…

2 Likes

@melissa.fabros if you want to get predictions on the whole train folder it is easier to use predict_generator as used in jeremy’s vgg.test function than using just .predict .
regarding the 4 hours training it is not normal, are you using the gpu?

I’m getting run time errors when running lesson 1 code. Any suggestions on how to resolve this?

I have the same question! I already asked it in YouTube comments as well as in this forum in another topic. If I get an answer over there I’ll let you know.

Are you running this at your local machine or on AWS? Try to set the batch size to a smaller number if you do not have a GPU with lots of memory.

I didn’t see any css. what part?

Thanks @Matthew . There’s no mention of that notebook in the wiki.

I’m running it on my local machine. I have NVIDIA GTX965 4GB . I had changed the batch size from 64 to 32 to 16 but it makes no difference.

I would have thought that my GPU could handle this relatively undemanding task.

Reducing the batch size actually worked. I just forgot to re run the preceding code segments. I had the batch size set to 16 at that point and it took about 8 minutes to process. I will try with a larger batch sizes of 32.

Thanks for the tip, Maxim.

1 Like

@dhatawesomedude what are you talking about? Issue is resolved though. By uploading the downloaded file.

@altmbr . My bad. I think I replied the wrong post.

@jeremy I have worked through lesson one successfully. My jupyter notebook will effectively classify the cats vs. dogs data set with 97% accuracy as described in the video. I am trying to run the Vgg16 model on a data set of my own. I structured the directories to mimic that of the dogscats directory. The images show up as expected under the plots(imgs, titles=labels) line. However, the predicted labels are not the names of my two directories. Do I understand correctly that Vgg16 is pre-trained to recognize only images contained on ImageNet? The images I am trying to use are not from ImageNet.

If that is the case, do you have suggestions or resources on how to train Vgg16 (or something similar) for a set of images not contained on ImageNet.

I am running aws p2 and am using an AWS server.