Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.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
Tensorflow 如何使用TPU保存Keras中的最佳模型?I';I’我越来越不成功了_Tensorflow_Keras_Tensorflow2.0 - Fatal编程技术网

Tensorflow 如何使用TPU保存Keras中的最佳模型?I';I’我越来越不成功了

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

我的代码目前在cpu/gpu上运行良好,保存了我以后加载的最佳模型。我正在试验TPU,在我的第一个时代之后,我得到了一个
未实现的错误

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
,看看问题是否得到解决?