I found out from the first lesson that I have to configure web services like ‘paperspace’. But, I have a laptop with GTX1050, is it not possible to configure this GPU itself and run the programs??
I came across the same issue last week when I was trying to set up my machine. I waited about 3 days before I sent a support ticket and they approved my request within 24 hours after.
Hi, I had run the lesson 1 notebook earlier on Google Colab without any issue. However yesterday when I tried to re-run it, facing below error. AxisError: axis 1 is out of bounds for array of dimension 1
Thanks for the reply!
I am new to these GPU configurations. Could you please clarify my below thoughts.
We use WEB services for training when one does not have a GPU in his\her PC.
If the appropriate GPU is available in PC, we do not need to use any WEB services. Right? We just have to configure the GPU available on PC for training.
If my understanding is correct, how do I configure GPU on my laptop for trainin g?
Notice the different between your accuray() and the current up-to-date accuracy() function. Then, try using the current up-to-date notebook. For that part code it is now (using accuracy_np() )
log_preds,y = learn.TTA()
probs = np.mean(np.exp(log_preds),0)
accuracy_np(probs, y)
Further, check out the dimension of log_preds, and probs in your code. log_preds should be a 3D-array, then after average over the first dimension, probs should be a 2D-array. If probs is not a 2D-array, you get that error.
To get through this course GPU is required. You can have it by using cloud services like AWS, Paperspace, GCP, … or you have it on your own computer. In either cases, you need to set up the environment to run the course’s notebooks. Set up might take a lot of time and hassle depending on what platform you choose. The easiest way is using Paperspace and the hardest way might be to configure your own computer. Please refer to this excellent repo where @reshama documented how to configure platforms for this course.
Thanks for your response.
The notebook does a “!pip install fastai” at the beginning. So perhaps the package needs to be updated at the source.
In my case, I see log_preds is 2D array and probs is 1D. I understood what the error was hence replaced probs with log_preds and everything worked. Just need to figure out now if with that change it is working as intended. Thanks.
I set up Paperspace yesterday and there was actually very little time needed.
It took me 2 tries though. The first one got stuck loading when trying to open. I removed that one and created a new machine, that one loaded up in seconds.
Hello all,
Just to share one more experience with paperspace - I signed up today around 6 hours ago, tried to set up a machine with no luck so far. After couple of hours of waiting I created a ticket to support, and that’s the info I got from them recently by email:
Thanks for reaching out, and apologies for the delay on your request. Typically we’re able to get users approved within a couple hours With a surge in requests for these instance types, we’re a little behind. We’re in the process of adding capacity right now, so please sit tight and you’ll get a notification the moment a seat is available. We appreciate your patience!
So, waiting…
Hope this helps.
P.S. Meanwhile setting up crestle took 2 minutes and 3 clicks, and allowed to successfully go through the 1st lesson
I have questions about cell 15 from the Lesson1 Notebook about precomputed activations.
# Uncomment the below if you need to reset your precomputed activations# #shutil.rmtree(f'{PATH}tmp', ignore_errors=True)
Why does learn.fit(0.01, 2) in the next cell execute faster with precomputed activations and slower if I execute shutil.rmtree(f'{PATH}tmp', ignore_errors=True) ? Isnt it running learn.fit on the same data in either case (i.e data from dogscats/train)
If I delete the precomputed activations, how do I get them back? Do I have to do a fresh download of the “tmp” folder from the paperspace script?
Just to clarify using precomputed activations - our network has already learned weights using a large image data and we are going to fine-tune them using our “train” folder. Correct?
First let us explained the idea of precomputed activations
Let’s go back to the network, consider resnet50.
When finetuning a model we train only the last layer and previous ones (freeze layers) remain unchanged. So all computations on the freeze layers will be the same ie: the result of image 1 (of my training set) going from C1 to FC7 layers will never change or we do it many times with same images. In fact an epoch is a tour over all images of the training set so training during 10 epochs means I’ll do the same computation 10 times. This is a waste, so we take a shortcut, we precompute all training image results from 1st to last fixed layers, here from C1 to FC7 and save them: this is the precomputed activations. In doing so it’ll be fast because we’ll use results of fixed layers computations (precomputed activations) and compute only from FC7 to FC8 for each image.
So the question 1:
The response is clear, it will take much time because it’ll apply all fixed layers to all training images. But the next times will be faster.
Question 2:
No, you have to run fit but make sure to use the attribute precompute=True: learn.fit(0.01, 2, precompute=True)
Question 3:
Precomputed activations and pretrained weights are two differents things.
Precomputed activations help speeding computations during training a network while pretrained weights are like the level of knowledge acquired by the network after some training on some data.