Course 2 Wk 4 Assignment

Like others, I originally had the error " [ValueError: Shapes (None, 1) and (None, 26) are incompatible]"
Unlike the other discussions I have seen here the error did not stem from loss =, but rather from the labels type. I changed the labels to integer using astype() and this fixed the ValueError problem.

However, when graded, I received the following note:
“Failed test case: incorrect dtype for labels array when using csv with 100 data points.
Expected:
either np.float64 or np.float32,
but got:
int64.”

Please advise. Many thanks!

1 Like

See this on the markdown for Parsing the dataset:
These numpy arrays should have type float64

Check after parse_data_from_input:

print(training_labels.dtype)

# output
dtype('float64')
3 Likes