# Example of a picture that was wrongly classified.
index = 1
plt.imshow(test_set_x[:,index].reshape((num_px, num_px, 3)))
#print(str(test_set_y[0,index]))
#print(classes[d["Y_prediction_test"][0,index]].decode("utf-8"))
#print(d["Y_prediction_test"][0,index])
#type(d["Y_prediction_test"][0,index])
print ("y = " + str(test_set_y[0,index]) + ", you predicted that it is a \"" + classes[int(d["Y_prediction_test"][0,index])].decode("utf-8") + "\" picture.")
吴恩达深度学习课后编程作业IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and i
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices出现这个错误是数据类型错误,错误如下图所示找到所在错误行所用的数据然后查看是哪个数据错误注释错误的哪一行,并将所有的单个数据输出运行,找出错...