Lesson 4 - trying to tie pieces together

I spent last day trying to come up with very basic Statefarm submission that at least compiles up to the point where I can create submission file. So far it’s been uphill struggle with out of memory, syntax and definition errors.

Closer to the end, “Submit” section:
keras.metrics.categorical_crossentropy(val_labels, do_clip(val_preds, 0.93)).eval()

Definition of val_preds is missing. Where does it comes from or how it’s calculated?

This code gives me an error:
preds = bn_model.predict(conv_test_feat, batch_size=batch_size*2)

ValueError: Error when checking : expected batchnormalization_input_1 to have 4 dimensions, but got array with shape (79726, 10)

Any ideas how i solve this?

the shape of the array to be predicted does not match the expected shape. so you can reshape (,10 ) to (,4)

Can you share the model code you used. It can help in answering better.

Thank you Vishnu,

No.2 was caused by me using model from statefarm-sample and using “Submit” code from statefarm - main.
I’ll try to tackle this today.

Could you let me know how you solved problem 1? So, where does val_preds come from?

1 Like