Slow runtime C2W1 assign

When I tried running the grade required cell for the function split_data() in Google Colab I waited 20 minutes but it was still working. I tried switching to standard runtime type from GPU but no improvement…

Is there any way to speed up the code?

Hello @Jacob_Svensson ,

It is not supposed to take so long.

Possibly you have used some inapproprate parameters /inputs. Could you try re-evaluating code?

With regards,
Nilosree Sengupta

I dont think I have used inappropriate inputs. The one issue I can see is that I used a for loop to iterate over the files, but I don’t see a way to solve it without using one

Thank you,

Jacob

Hello @Jacob_Svensson ,

For loops are definitely needed.
Check if you have used proper indentations.

With regards,
Nilosree Sengupta

Hello @Jacob_Svensson ,

If you can’t figure out, no issues. Send me your notebook via dm such that I can check where it went wrong. By clicking on the profile picture, you will see an option to message. There you can attach your notebook. Then we can discuss the issues here.

With regards,
Nilosree Sengupta

Hello @Jacob_Svensson ,

I have gone through your snippet.
There are several issues.

  1. Logic is not correct for this part : All images should be checked before the copy, so if they have a zero file length, they will be omitted from the copying process.

  2. Next,
    At first , You need to find training and testing length.
    Then shuffle.
    Then find training set and testing set.

Follow the hints and Check this :

With regards,
Nilosree Sengupta

Hello @Jacob_Svensson ,

Saw your updated notebook. Now your logic is okay.
But issue is indentation as I had said before :

Use Shift+tab to get the code indentated properly in the follwing code block :

# Finding training and testing length
.
.
.
# copying file to destination

This will execute it in few seconds.

Dms are only for sending notebooks. You can freely discuss your issues here.
Let me know if you get stuck.

Happy learning!

With regards,
Nilosree Sengupta

I am also facing the same problem.
Did you find the solution?

Create a new post with the screenshot of your error or issue encountered and proper explaining of your problem.

Regards
DP

I have the same problem. The code block is running for more than 20 minutes but it is still going on

Longer training time can be encountered if one has not got the dataset codes as per the requirement. Also if there is any issue with the model algorithm. One needs to understand even if ones codes are correct, one can still encounter issue based on what one choose for convolution layer, batch size, learning rate and other parameters.

Kindly share your notebook via personal DM. I sincerely suggest you to create a new post, so there is a better log about what you encountered, it is not necessary that reason behind the issue might or might not be same.

Regards
DP

Hello @Writobrata ,

He hasn’t responded since then in community. But his particular issue was solved with these and I know since I had his notebook :

Try these.
If these doesn’t help, create a separate post as @Deepti_Prasad has said, she will guide you there. There can be some different issue that will have a different solution.

With regards,
Nilosree Sengupta

he created nilosree :slight_smile: and I have responded.

Hello @Deepti_Prasad ,

I don’t know about your dms.
I meant I didn’t see him replying back to this particular thread in community.

With regards,
Nilosree Sengupta

Sorry. I had created another topic and said the issue was resolved. Thank you @nilosreesengupta and @Deepti_Prasad