for i in range20 rand_num = randomrandint11000 label = npwherey_testrand_numBrogueClogBoatSneakerBallet FlatBrogueClogBoatSneakerBallet Flat #计算one-hot pixels = x_testrand_num pixels =
for i in range(20): rand_num = random.randint(1,1000) label = np.argmax(y_test[rand_num]) #计算one-hot pixels = x_test[rand_num] pixels = pixels.reshape((128,128,3)) plt.title('Label is ' + str(label)) plt.imshow(pixels,cmap='gray') plt.show() print('测试样本第{}个,预测结果是{}'.format(rand_num,classes_x[classes_y_pred[rand_num]])) if classes_y_pred[rand_num] != label: print('预测错误')
原文地址: https://www.cveoy.top/t/topic/gdW2 著作权归作者所有。请勿转载和采集!