lululxvi / deeponet

Learning nonlinear operators via DeepONet
Other
474 stars 130 forks source link

ValueError: The passed save_path is not a valid checkpoint: model/model.ckpt-43000 #15

Open JianfengNing opened 2 years ago

JianfengNing commented 2 years ago

How to fix this problem?

raceback (most recent call last): File "D:/Desktop/Codes/deeponet-master/deeponet-master/src/deeponet_pde.py", line 285, in main() File "D:/Desktop/Codes/deeponet-master/deeponet-master/src/deeponet_pde.py", line 281, in main run(problem, system, space, T, m, nn, net, lr, epochs, num_train, num_test) File "D:/Desktop/Codes/deeponet-master/deeponet-master/src/deeponet_pde.py", line 176, in run model.restore("model/model.ckpt-" + str(train_state.best_step), verbose=1) File "D:\Users\FIVE\miniconda3\lib\site-packages\deepxde\model.py", line 666, in restore self.saver.restore(self.sess, save_path) File "D:\Users\FIVE\miniconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1290, in restore raise ValueError("The passed save_path is not a valid checkpoint: " + ValueError: The passed save_path is not a valid checkpoint: model/model.ckpt-43000

lululxvi commented 2 years ago

What is your backend?

JianfengNing commented 2 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

tf2.x

On 12/7/2021 09:20,Lu ***@***.***> wrote: 

What is your backend?

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.

MinZhu123 commented 2 years ago

You could replace the error line with model.restore(f"model/model-{train_state.best_step}.ckpt", verbose=1)

cfd-ai commented 2 years ago

@minzhu-penn - May I know which version of TensorFlow you use and which backend?
I had to do this: model.restore("model/model.ckpt-" + str(train_state.best_step) + ".ckpt", verbose=1) Because model files are like: model.ckpt-500.ckpt.meta model.ckpt-500.ckpt.index model.ckpt-500.ckpt.data-00000-of-00001

Backend: tensorflow.compat.v1 TensorFlow version: 2.6.2

DaJiang7 commented 2 years ago

@JianfengNing I have the same problem as you. You can check the running memory of the computer.

anshumansinha16 commented 1 year ago

I am getting this error as well! My backend is : Using backend: tensorflow.compat.v1'

code:

# Restore the best test loss model
    model.restore( save_dir +save_str+"/model.ckpt-" + str(np.argmin(model.losshistory.loss_test)*100), verbose=0)

Error:

Traceback (most recent call last):
  File "/Users/anshumansinha/Desktop/ML_project/./main.py", line 311, in <module>
    NN_MSEs_test, NN_MSEs_train = DeepONet(samples, split, y/np.max(np.abs(y)) , I, inds, neurons, epochs, b_layers)
  File "/Users/anshumansinha/Desktop/ML_project/./main.py", line 289, in DeepONet
    model.restore( save_dir +save_str+"/model.ckpt-" + str(np.argmin(model.losshistory.loss_test)*100), verbose=0)
  File "/Users/anshumansinha/venv/lib/python3.10/site-packages/deepxde/model.py", line 914, in restore
    self.saver.restore(self.sess, save_path)
  File "/Users/anshumansinha/venv/lib/python3.10/site-packages/tensorflow/python/training/saver.py", line 1409, in restore
    raise ValueError("The passed save_path is not a valid checkpoint: " +
ValueError: The passed save_path is not a valid checkpoint: /Users/anshumansinha/Desktop/ML_project/model/Levin1_Seed_1_Samples_100_X_4_5_epochs_10_blayers_3_neurons_125/model.ckpt-100
anshumansinha16 commented 1 year ago

What is your backend?

I am using, `Using backend: tensorflow.compat.v1' and getting similar error : link

lululxvi commented 1 year ago

See FAQ Q: More details about DeepXDE source code, and want to modify DeepXDE at https://deepxde.readthedocs.io/en/latest/user/faq.html