Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Machine learning 无法在训练过程中使用keras保存最佳重量_Machine Learning_Keras_Deep Learning_Pycharm - Fatal编程技术网

Machine learning 无法在训练过程中使用keras保存最佳重量

Machine learning 无法在训练过程中使用keras保存最佳重量,machine-learning,keras,deep-learning,pycharm,Machine Learning,Keras,Deep Learning,Pycharm,我是凯拉斯的新手。我希望保存具有最佳权重的模型,如: model1.compile(loss="mean_squared_error", optimizer="RMSprop") model1.summary() mcp_save = ModelCheckpoint('best_model.h5', save_best_only=True, monitor='val_accuracy', mode='auto', verbose=2) callbacks_list = [mcp_save]

我是凯拉斯的新手。我希望保存具有最佳权重的模型,如:

model1.compile(loss="mean_squared_error", optimizer="RMSprop")

model1.summary()

mcp_save = ModelCheckpoint('best_model.h5', save_best_only=True, monitor='val_accuracy', mode='auto', verbose=2)
callbacks_list = [mcp_save]


epochs = 5000
batch_size = 50

# fit the model
history = model1.fit(x_train, y_train,
                batch_size=batch_size,
                epochs=epochs,
                callbacks=callbacks_list,
                validation_data=(x_test, y_test),
                verbose=2)

我在Pycharm 2019社区版上没有看到警告或错误消息。但培训过程完成后,我无法在项目文件夹或我的计算机上的其他地方看到“best_model.h5”??你能给我一些建议吗??我的缺点是什么???

我觉得你的代码很好。我经常使用这个回调。我建议您使用完整路径来指定保存模型的位置,而不是相对路径