C3W1 birdbox assignment

I am having trouble with the def get_visualization_training_dataset() function. I was first running the colab on a TPU but then decided the training was too slow. The function worked correctly this time.
Then after I went to change GPU to a more powerful one I had to run the code again from the top down. However now I am seeing an error with the def get_visualization_training_dataset() function I dont know how to solve (I did not change the code). Does someone know how to solve this?
Thanks in advance


I have exactly the same problem, I would appreciate if someone can answer this!

Okay, I fixed it, what I did is inside the function dataset_to_numpy_util I changed this:

return (np.array(ds_images), np.array(ds_bboxes))

to this:

ds_images_np = np.array(ds_images, dtype=object)
ds_bboxes_np = np.array(ds_bboxes, dtype=object)

return ds_images_np, ds_bboxes_np

so it accepts all types of objects and it now finally works

1 Like

Is your issue resolved? Could you check if koko resolution could solve also your problem? If not, le us know. The issue is with the implementation of shape.

Actually, this doesn’t resolve it because later I can’t run model.fit()

I saw another post highlighting a similar issue which suggested to download the dataset from kaggle and load it from drive but it outputs the same error.

Çan you share a screenshot on what it shows when you run the cell you are mentioning now, show only input. Please don’t post any codes.

i got same error and not fix by the thing that koko tell

I think this is a non grader cell right?

I get the same errors and yes, it is not a graded cell, it’s from the first ones you are not supposed to change.

yes koko I am look into, kindly give me sometime to get back.

koko can you tell me what output you got on running the model, fit() when you did editing of dataset images??

Even if error please share the image here.


The error was “Failed to convert a NumPy array to a Tensor (Unsupported object type float).”
I do not have a screenshot since Google Colab says I have run out of compute units and it says 10 mins per epoch which is an eternity, even with GPU it is 30 secs per 50 epocs which would be 25 mins so.

And I also have the same problem. Seems like a small bug in the original code, either in get_visualization_training_dataset() or in dataset_to_numpy_util()

OK, there is some mistake because the code calls non-normalized images which have different sizes and hence inconsistency when numpy.array() them. So need to call normalized images. This will fix the problem:

However, after using this fix, whether I use bboxes_normalized=False or True, the bounding box does not plot in either training or validation pics… Still there are some open questions…

1 Like

Same issue here.

This is quite disturbing. I can’t pass the assignment.

Hi everyone! We are looking into this. Please give us till Tuesday to resolve the issues. You can first go ahead to Week 2 in the meantime. Thank you and sorry for the inconvenience!


Thanks, Chris. I suspect there still is the issue of data preparation script flow, I get 0/100 for the result, and bounding boxes look very weird and all IOU are close to 0 and grader graded me 0/100 (perfect score!!!)
If possible, please add some checklist to make sure data is prepared correctly, so we do not go to train model (very long procedure) before we verify that the data fed is correct data.
Thank you

Hi everyone! The bug should now be fixed. Please re-open the notebook from the classroom to see the changes. Thanks!