【发布时间】:2020-05-04 13:17:30
【问题描述】:
正如标题所暗示的那样,预测的输出是 1.0 或 0.0,我没有得到任何介于两者之间的值,导致我的输出要么是 100% 下降,要么是 100% 非下降。
for img in imagesList:
test_image = image.load_img(path+img, target_size=(64, 64))
test_images = image.img_to_array(test_image)
test_images = np.expand_dims(test_image, axis = 0)
result = classifier.predict(test_images)
if result[0][0] <= 0.0:
prediction = 'fall'
print('The file is:{} while model output is: {}{} {} '.format(img[:-4],((1-result[0][0])*100),'%',prediction))
print(result[0][0])
#print('The file is:{} while model output is: {}{} {}'.format(img[:-4],((result[0][0])*100),'%',' nonfall'))
else:
prediction = 'nonfall'
print('The file is:{} while model output is: {}{} {} '.format(img[:-4],((result[0][0])*100),'%',prediction))
print(result[0][0])
【问题讨论】:
-
classifier是如何定义的? -
分类器是cnn模型。
标签: tensorflow keras conv-neural-network