C3W2 Assignment: Grader ran out of memory while grading the submission

If you do face this error message “Grader ran out of memory while grading the submission. Please contact support or wait for 24 hours to submit” from the grader’s output, comment in this thread if it is still not solved after 24 hours and we will figure out a way to get it solved.

Edit (26th October 2020, 10 PM PST) :

  1. The num_examples should be 500 to avoid the memory issues. If you have loaded the notebook before 26th October 10PM PST, please either edit the value to 500 in that cell or do a clean pull of a new notebook by clicking on Lab Help on top right of your notebook.

1) Check if your model summary and all the expected outputs are same

  1. Check if you haven’t added any additional cell or edited the graded cells.
4 Likes

Not a run out of memory error, but a too many values to unpack error in cell 3. This should not be the case though since all tests pass. I am using the with_info flag and not the as_supervised flag. Very frustrating (using the as_supervised flag throws an error in the mapped function later)

1 Like

Hi @tf2_mentors,

Can someone please help out @bwutzke ?

Thanks,
Mubsi

1 Like

please check the dataset version that you are using.
Remember to use cats_vs_dogs:4.*.* as dataset because 4.0 support the new Splits API and check the splits list once again, if it doesn’t resolve the issue please attach a code snippet of the entire cell so that we can help you out better

2 Likes

Yeah, I double checked your suggestions. Here is my code for that cell.

“(Solution code removed by mentor, as displaying it is against honour code)”
1 Like

I use the latest version and do not encounter the problem. Perhaps (but not sure) using the newest dataset may help.

2 Likes

Hey @bwutzke, This particular code seems fine and working perfectly for me.

Although if you are not using with_info flag and still keep the same code, this will result in the said error:

—> 11 splits, info = tfds.load(‘cats_vs_dogs:4..’, data_dir = filePath, split = splits, as_supervised=True)
12
13 (train_examples, validation_examples, test_examples) = splits

ValueError: too many values to unpack (expected 2)

For this what is happening is, if we are not using with_info flag, it won’t return any info, so in that case, where you use as_supervised or not, removing info variable will work, because it won’t be returning that.

Hope this clears it up. I have used the same code you posted.
Thank You.

2 Likes

If you use the as_supervised flag it changes the shape of your return sets since they will now have the additional label. This breaks the mapped function in a later cell. The over arching issue is with the auto grader, if you alter anything that is not explicitly marked as “add code here” then you potentially break the auto grader and still get a failure. What I do not understand here is when I have two return variables, and I only pass the with_info flag, I should get two return variables. The auto grader is saying that I have more than that.

1 Like

For cell 5, when using the with_info and as_supervised flags in cell 3 we get another error:
“(Solution code removed by mentor, as displaying it is against honour code)”

1 Like

Ok, ok, this is the most ridiculous thing ever. I had created another notebook as a copy of the original notebook and trying to submit that notebook was the problem.

1 Like

Do not post the code directly

2 Likes

Might I refer you to the above post from course mentor Khushwanth:

With special emphasis on the last sentence.

1 Like

Can you check my submission? It says Cell #5. Can't compile the student's code. Error: InvalidArgumentError() I have been waited for 24 hours from the first submission. How can I resolve this problem?

1 Like

Apologies, can’t say I’ve waited 24 hours and it may be completely unrelated to memory, but I have the same issue as Jiwon_Kim1 on this assignment. It may be a PEBCAK issue, but if I could at least get guidance on which cell #5 is, that may help. Cell 5 appears to me to be one without any expected student changes. But maybe it’s only counting code cells?

Sorry to bump this so long after it was created as well :grimacing:

1 Like

hey,
i kept get this error when submit for grading, i think the environment has issue, can soneone help take a look?

Cell #3. Can’t compile the student’s code. Error: TypeError(“init() missing 2 required positional arguments: ‘op’ and ‘message’”,)

1 Like

i get an error in the cell #3 like this:

Cell #3. Can’t compile the student’s code. Error: TypeError(“init() missing 2 required positional arguments: ‘op’ and ‘message’”,)

and my coding in cell #3 is:

EXERCISE: Split the dataset

Memuat dataset cats_vs_dogs

dataset, info = tfds.load(‘cats_vs_dogs’, with_info=True, as_supervised=True)

Dapatkan dataset ‘train’

train_data = dataset[‘train’]

Hitung jumlah data untuk setiap split

total_examples = info.splits[‘train’].num_examples

Tentukan jumlah gambar untuk training, validation, dan test set

train_size = int(0.10 * total_examples) # 10% untuk training
val_size = int(0.05 * total_examples) # 5% untuk validation
test_size = int(0.05 * total_examples) # 5% untuk test

Ambil 10% pertama sebagai training set

train_examples = train_data.take(train_size)

Ambil 5% berikutnya sebagai validation set

validation_examples = train_data.skip(train_size).take(val_size)

Ambil 5% terakhir sebagai test set

test_examples = train_data.skip(train_size + val_size).take(test_size)

Untuk menghitung jumlah elemen dalam dataset tanpa menggunakan list(), kita gunakan cara ini:

num_train_examples = sum(1 for _ in train_examples)
num_validation_examples = sum(1 for _ in validation_examples)
num_test_examples = sum(1 for _ in test_examples)

print(num_train_examples)
print(num_validation_examples)
print(num_test_examples)

and if I change it according to the lab’s instructions, it always says ‘The kernel appears to have died. It will restart automatically.’

import tensorflow_datasets as tfds

EXERCISE: Split the dataset

splits = [‘train[:10%]’, ‘train[10%:15%]’, ‘train[15%:]’]

Remember to use cats_vs_dogs:4.*.*

cats_vs_dogs  |  TensorFlow Datasets

It has been downloaded for you so use the data_dir parameter (use ‘data_dir’ if running on Coursera, otherwise skip that parameter)

else it will try to download the dataset and give you an error here

splits, info = tfds.load(‘cats_vs_dogs:4..’, split=splits, as_supervised=True, with_info=True)

(train_examples, validation_examples, test_examples) = splits

Testing lengths of the data if they are loaded correctly. Do not edit the code below

train_len = len(list(train_examples))
validation_len = len(list(validation_examples))
test_len = len(list(test_examples))
print(train_len)
print(validation_len)
print(test_len)