When this function is being called: (visualization_training_images, visualization_training_bboxes) = dataset_to_numpy_util(visualization_training_dataset, N=10)
We get error: ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (10,) + inhomogeneous part.
Because with this function: dataset_to_numpy_util (converts images to arrays, adds to list and then converts list to array.) When images are of different size, they can not be added to array.
So the question is. Am I missing something? Should I add resizing of images myself?
Update:
I have used image resizing through dataset.map: normalized_dataset = dataset.map(read_image_with_shape)
and updated the for loop with one: for original_images, images, bboxes in take_dataset:
Now training works.
Another problem is that I don’t have “Colab” google account, so did all the work locally on my PC with tensorflow 2.13 and then model is not loadable with tensorflow 2.8.
So create virtual environment with just tensorflow 2.8 (cpu version is enough), then load model with: model = tf.keras.models.load_model("birds.h5", compile=False), then compile it with your parameters from original code model.compile(optimizer=... , loss=...) and save again. After uploading grader passed.