deeponet icon indicating copy to clipboard operation
deeponet copied to clipboard

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

Open JianfengNing opened this issue 3 years ago • 8 comments

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

JianfengNing avatar Dec 06 '21 13:12 JianfengNing

What is your backend?

lululxvi avatar Dec 07 '21 01:12 lululxvi

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.

JianfengNing avatar Dec 12 '21 01:12 JianfengNing

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

MinZhu123 avatar Dec 12 '21 20:12 MinZhu123

@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

cfd-ai avatar Jan 29 '22 05:01 cfd-ai

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

DaJiang7 avatar Apr 17 '22 11:04 DaJiang7

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 avatar Sep 19 '22 15:09 anshumansinha16

What is your backend?

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

anshumansinha16 avatar Sep 19 '22 15:09 anshumansinha16

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

lululxvi avatar Sep 23 '22 23:09 lululxvi