maziarraissi / PINNs

Physics Informed Deep Learning: Data-driven Solutions and Discovery of Nonlinear Partial Differential Equations
https://maziarraissi.github.io/PINNs
MIT License
3.96k stars 1.29k forks source link

how does the code run in tensorflow 2.x? #17

Open ZhangRuibo1 opened 4 years ago

ZhangRuibo1 commented 4 years ago

Hello, dose someone have method to modify code to tensorflow 2.1?

engsbk commented 4 years ago

I tried to run it with tensorflow 2.x. It will not run without code modification to some outdated commands that were rolled out since tensorflow 1.14. If it is not necessary to use tensorflow 2.x, you can opt out to the following: 1-Uninstall the current version of tensorflow. 2-Install tensorflow==1.15 3-make sure the version of python you are using is 3.7, if not try to switch to this version.

This should make the .py files run successfully.

pacorikos commented 3 years ago

Would running it on 1.14 work fine or no? I assume python 3.7.9 works just as well?

Y1fanLiu commented 3 years ago

Just run it in Google Colab select tensorflow version 1.x Think it's 1.15

pacorikos commented 3 years ago

Just run it in Google Colab select tensorflow version 1.x Think it's 1.15

You cannot select a specific version, only 1.x. I am asking because I am looking to replicate the code and could not load tensorflow 1.15 on my conda and could only load 1.14.

matheusAltomare commented 3 years ago

I have created a version of this work with tf 2.x. I have the burger's equation solution implemented:

https://github.com/matheusAltomare/PINN

I hope to help.

pacorikos commented 3 years ago

@matheusAltomare I appreciate the code. Fortunately, I was able to use my current conditions (Python 3.7.9 and TensorFlow 1.14). I am also currently developing a PINN under those conditions that I can share with you.

helonayala commented 3 years ago

hi, the forward and inverse problem for the mass-spring-damper example in the paper is available below with tf 2 and subclassing

https://github.com/helonayala/pinn

extending it to the NS eqns. (x,y,t independent variables) shouldn't require too much effort. a suggestion on how to do it is given in the readme.md - pull requests are welcome :)

hope this helps

cheers

JetsonPaul commented 3 years ago

I have created a version of this work with tf 2.x. I have the burger's equation solution implemented:

https://github.com/matheusAltomare/PINN

I hope to help.

Hi Matheus, you dropped the work on it? Best regards Paul

wjdewolf commented 2 years ago

For me it's perfectly working with Python 3.7 and Tensorflow 1.14 (not 1.15)