benmoseley / FBPINNs

Solve forward and inverse problems related to partial differential equations using finite basis physics-informed neural networks (FBPINNs)
MIT License
306 stars 63 forks source link

no attribute 'cost_analysis' in training #15

Open kuijianChang opened 3 months ago

kuijianChang commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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'