Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The question of continuous idenfication and discrete identification #13

Open
jackyvava opened this issue Jul 14, 2023 · 0 comments
Open

Comments

@jackyvava
Copy link

When I run code on colab, I always get errors when running the continuous idenfication and discrete identification modules:

None
—— Starting Adam optimization ——

KeyError Traceback (most recent call last)
in <cell line: 40>()
38 layers[-1] = q
39 pinn = PhysicsInformedNN(layers, tf_optimizer, logger, dt, lb, ub, q, IRK_alpha, IRK_beta)
---> 40 pinn.fit(x_0, u_0, x_1, u_1, tf_epochs)
41 U_0_pred, U_1_pred = pinn.predict(x_star)
42 lambda_1_pred_noisy, lambda_2_pred_noisy = pinn.get_params(numpy=True)

13 frames
/usr/local/lib/python3.10/dist-packages/keras/optimizers/optimizer.py in _update_step(self, gradient, variable)
230 return
231 if self._var_key(variable) not in self._index_dict:
--> 232 raise KeyError(
233 f"The optimizer cannot recognize variable {variable.name}. "
234 "This usually means you are trying to call the optimizer to "

KeyError: in user code:

File "/usr/local/lib/python3.10/dist-packages/keras/optimizers/optimizer.py", line 224, in _update_step_xla  *
    return self._update_step(gradient, variable)
File "/usr/local/lib/python3.10/dist-packages/keras/optimizers/optimizer.py", line 232, in _update_step  **
    raise KeyError(

KeyError: 'The optimizer cannot recognize variable dense_4/kernel:0. This usually means you are trying to call the optimizer to update different parts of the model separately. Please call `optimizer.build(variables)` with the full list of trainable variables before the training loop or use legacy optimizer `tf.keras.optimizers.legacy.Adam.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant