About data type mismatch

Hi, I received an error: main.DataValidationError: Features array for query is not float32. dtype is: float64.
After checking my submission and printing the data type multiple times, I am pretty sure that my data stored in the .npz file and data generated by main.py is not type float64. Could you check the output of my submission or maybe give a little more context on the call stack?

Hey @ricardoli0816-

I think the problem might be that your code is converting a numpy array with a float32 dtype into a python list, then implicitly converting that to a numpy array when you call np.savez. By default, numpy will serialize the floats in that array to float64 dtype, as in this example:

>>> np.array(np.array([1.0, 2.0, 3.0]).astype('float32').tolist()).dtype
dtype('float64')

Have you tried running make test-submission with the most recent version of the container to confirm that this passes locally before submitting? You can inspect all the things the runtime container is doing in the repository.

I think to be safe, if you want to save with float32 dtype, the object you serialize and save should be a numpy array with float32 dtype, not a list of numpy arrays with float32 dtype.

Hope this helps!

-Chris