Bird Boxes training error

I am getting an error at the model . fit portion.

this is the code and error message:
history =,epochs=EPOCHS,steps_per_epoch=steps_per_epoch,validation_data=validation_dataset,validation_steps=validation_steps)

TypeError: Expected float32 passed to parameter ‘y’ of op ‘Equal’, got ‘auto’ of type ‘str’ instead. Error: Expected float32, but got auto of type ‘str’.

This error says that you are passing y (which are the labels) of the dataset as string type and it needs those as float. It is probable that you might be given them as strings and you might need to perform some form of encoding in the cells above, and you probably have missed that!

I still haven’t been able to figure it out :disappointed_relieved:

I have gone through the code and everything seems fine but I am still getting same error… Im confused. Pls help me out.

Send me your notebook on private message I will have a look on it.

i have sent it to you please.

Your problem is a simple mistake when you define the loss in model.compile, loss=function() should be ended with a closed brackets.

Another way is just to pass the right string like ‘loss’. Have a look on the TensorFlow mean squared error loss.

Thanks Boss, I appreciate it.

1 Like

Ok, a few things that I found out.

Your implementation of the train_step_fn() is not right. The process of obtaining the processed_img and true_shape is not right and you have hard-coded the model instead of using arguments of the function.

Secondly when you Exercise 9: Select the prediction layer variables its better to use indexing I suggest here. At restore checkpoint remove the expect_spatial, I dont know whats it doing there. Try fixing these and see of it can run through!