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

no attribute 'cost_analysis' in training #15

Open
kuijianChang opened this issue Jul 10, 2024 · 3 comments
Open

no attribute 'cost_analysis' in training #15

kuijianChang opened this issue Jul 10, 2024 · 3 comments

Comments

@kuijianChang
Copy link

Dear Ben,
Hello, when I run the example such as 1D harmonic oscillator problem , a code error was encountered in trainers.py as following:
Traceback (most recent call last):
\test.py", line 38, in
run.train()# start training the FBPINN
\FBPINNs-main\fbpinns\trainers.py", line 654, in train
cost_ = update.cost_analysis()
AttributeError: 'Compiled' object has no attribute 'cost_analysis'.
Could you please help me figure out where the error is? Thank you very much!

@benmoseley
Copy link
Owner

Hi @kuijianChang can you provide more details on your environment/ JAX version (include output of import jax; jax.print_environment_info())?
It looks like compilation is not producing any cost analysis. This cost analysis is only used for logging output, and so can just be skipped (by setting cost_ = False in \FBPINNs-main\fbpinns\trainers.py", line 654

@kuijianChang
Copy link
Author

Thank you for your reply.
I use jaxlib-0.3.14-cp37-none-win_amd64.whl for installation. Both jaxlib and jax are 0.3.14 in Windows, x86_64. So there exits a WARNING:absl:No GPU/TPU found, falling back to CPU.
The result of jax.print_environment_info() is:
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'jax' has no attribute 'print_environment_info'

@kuijianChang
Copy link
Author

If only skip cost_ = update.cost_analysis() by cost_ = False in \FBPINNs-main\fbpinns\trainers.py", line 654, the error is the same: AttributeError: 'Compiled' object has no attribute 'cost_analysis'

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

2 participants