deepxde icon indicating copy to clipboard operation
deepxde copied to clipboard

Error during restore model

Open Haroncf opened this issue 1 year ago • 3 comments

Hi lulu, I have this same problem: https://github.com/lululxvi/deepxde/issues/323 and I can't test in Ubuntu/Linux. However, what I realized about this problem:

  • If I compile/train the model, restart the kernel on my jupyter notebook, and restore the model. It will work.
  • If I compile/train the model, and try to restore the model without restart the kernel. It will not work.

I need to train the model with a lot diferente datasets. So I will use a loop to compile/train/save, change the dataset, restore the model, and train again. A example with a simple code:

> model = dde.Model(data, net)
> model.compile("adam", learning_rate, loss_weights)
> model.train(iterations=1500, model_save_path="./result/adam_bfgs-1000.ckpt")

> model = dde.Model(data2, net)
> model.compile("adam", learning_rate, loss_weights)
> model.restore(save_path="./result/adam_bfgs-1000.ckpt")

NotFoundError: 2 root error(s) found.
  (0) NOT_FOUND: Key beta1_power not found in checkpoint
	 [[{{node save_1/RestoreV2}}]]
	 [[save_1/RestoreV2/_43]]
  (1) NOT_FOUND: Key beta1_power not found in checkpoint
	 [[{{node save_1/RestoreV2}}]]
0 successful operations.
0 derived errors ignored.

I didn't understand why it occurs if I don't restart the kernel on my jupyter notebook. I also tried to change the variable name "model2 = dde.Model(data2, net)", and it did not work.

Did you resolve this problem?

Thanks a lot Haron CF

Haroncf avatar Jul 19 '23 17:07 Haroncf

I had the same problem as well. Compiling the model twice is not allowed as I have seen.

tsarikahin avatar Jul 24 '23 14:07 tsarikahin

How about trying PyTorch backend?

lululxvi avatar Aug 04 '23 20:08 lululxvi

I used PyTorch backend and It worked

Thanks

Haroncf avatar Aug 11 '23 12:08 Haroncf