0

我想加载我的模型并测试我的模型,我尝试过二进制类并且它工作然后我尝试使用多类但它没有工作,谁能告诉我如何解决这个问题

 json_file = open('modelBiometrik.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
loaded_model = model_from_json(loaded_model_json)
# load weights into new model
loaded_model.load_weights("modelBiometrik.h5")
print("Loaded model from disk")

# evaluate loaded model on test data
loaded_model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
score = loaded_model.evaluate(x1, y1, verbose=0)
print("%s: %.2f%%" % (loaded_model.metrics_names[1], score[1]*100))

我试图在互联网上找到但我没有找到它谢谢你的帮助

我收到了这个错误

File "C:\Users\lord bramasta\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\training_utils.py", line 145, in standardize_input_data
    str(data_shape))
ValueError: Error when checking target: expected dense_6 to have shape (15,) but got array with shape (1,)
4

0 回答 0