Tensorflow 如何使用TPU保存Keras中的最佳模型?I';I’我越来越不成功了
我的代码目前在cpu/gpu上运行良好,保存了我以后加载的最佳模型。我正在试验TPU,在我的第一个时代之后,我得到了一个Tensorflow 如何使用TPU保存Keras中的最佳模型?I';I’我越来越不成功了,tensorflow,keras,tensorflow2.0,Tensorflow,Keras,Tensorflow2.0,我的代码目前在cpu/gpu上运行良好,保存了我以后加载的最佳模型。我正在试验TPU,在我的第一个时代之后,我得到了一个未实现的错误 UnimplementedError: File system scheme '[local]' not implemented (file: './checkpoint/totalAssets-regressor.tfl.ckpt/variables/variables_temp_308014a81c644daca728cf71170d6555/part-000
未实现的错误
UnimplementedError: File system scheme '[local]' not implemented (file: './checkpoint/totalAssets-regressor.tfl.ckpt/variables/variables_temp_308014a81c644daca728cf71170d6555/part-00000-of-00001')
Encountered when executing an operation using EagerExecutor. This error cancels all future operations and poisons their output tensors.
我的代码相当简单:
checkpoint_filepath = './checkpoint/' + variableToPredict + '-regressor.tfl.ckpt'
mcp_save = ModelCheckpoint(filepath=checkpoint_filepath, save_best_only=True, monitor='mse', mode='min')
model.fit(X_train, y_train, epochs=1000, validation_split = 0.2,
callbacks=[mcp_save ])
是否有其他方法在每个历元后保存最佳模型?您能否尝试一个简单的路径,如/ModelSave/model{epoch:02d}.ckpt
,看看问题是否得到解决?