Finish 50 epochs need 13.89 hr

I have a question regarding running my Colab of the w1 assignment.

The training part with 50 epochs will take approximately 13.89 hours, as each epoch takes around 1000 seconds to complete. Could you please provide me with some suggestions on how to shorten this time? The current duration seems rather unreasonable.

Hi @Mengyuan_Wang1.
Are you using GPU?

1 Like

Good catch! Thank you! I didn’t to switch it to GPU as the step in the instruction.

It’s okay
Happy Learning!

If I use GPU how much exactly time to finish the train? I’m trying to use it but still needed approximately 10 hours to finish.

Hey @anggerzhr,

Are you working on same assignment or you ask in general?

yeah on same assignment, even though I already use GPU but it still takes a long time

Can you send me your notebook via DM to check it?

is the issue resolved?

Hello anggerzhr,

Create a mobilenet version 2 model object (THIS CODE NEEDS TO BE WRITTEN LIKE THIS :point_down:
mobilenet_model = tf.keras.applications.mobilenet_v2.MobileNetV2

def define_and_compile_model():
define the input layer
inputs = tf.keras.Input (THIS CODE IS INCORRECT, IT SHOULD BE tf.keras.layers.Input

Get the steps per epoch (may be a few lines of code)
if length_of_validation_dataset % BATCH_SIZE > 0:
steps_per_epoch += 1


1 Like

how do you solve it? My training takes approximately 10 hours


I’m having the same issues as the other students. The model takes a long time to train. I followed all instructions in this thread but it doesn’t seem to solve it.
Can you please advise?

This assignment needs to have look at 2 things your batch size and steps per epoch. So make sure your batch size not too large and steps per epoch is defined for both training and validation dataset as per batch size

I used the same batch size as in the ungraded labs and the steps are computed

How can I solve this problem? To use GDP I have to pay because colab has power limits

Can you send the codes only where the epoch numbers are mentioned via personal DM. Send a screenshot. Click on my name and then message

It is GPU, I didn’t get this power limit, can you explain. If your system doesn’t permit then you will have change your system/laptop/computer, if that is what you meant.

Cannot connect to GPU backend

You cannot currently connect to a GPU due to usage limits in Colab. Learn more

To get more access to GPUs, consider purchasing Colab compute units with Pay As You Go

That’s the message I receive.

True, GPU usage limit is a 24-hour cycle. So that’s why if you have used, start the next day in case you do not want to purchase premium colab.

you are not suppose share on posts. kindly delete the image containing codes :woman_facepalming: