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

Installation issue in Ubuntu 20.04.3 LTS #32

Open
chandukec opened this issue Dec 15, 2021 · 11 comments
Open

Installation issue in Ubuntu 20.04.3 LTS #32

chandukec opened this issue Dec 15, 2021 · 11 comments

Comments

@chandukec
Copy link

Hello,
I am trying to install this feature in OpenFOAM v 1906 in Ubuntu 20.04.3 LTS, I am facing the following issues:

  1. Using pip install -r requirements.txt, I am getting the following error:
ERROR: spyder 3.3.6 requires pyqt5<5.13; python_version >= "3", which is not installed.
ERROR: spyder 3.3.6 requires pyqtwebengine<5.13; python_version >= "3", which is not installed.
ERROR: astroid 2.3.1 requires typed-ast<1.5,>=1.4.0; implementation_name == "cpython" and python_version < "3.8", which is not installed.
ERROR: astroid 2.3.1 has requirement six==1.12, but you'll have six 1.14.0 which is incompatible.
Installing collected packages: terminado, notebook, opt-einsum, protobuf, pybind11, pydot, pydotplus, qtconsole, scipy, scikit-learn, sklearn, Werkzeug, tensorboard, wrapt, termcolor, tensorflow-estimator, tensorflow
  Found existing installation: terminado 0.8.2
ERROR: Cannot uninstall 'terminado'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Could I use coanda install -r requirements.txt to rectify this issue, I am using Python 3.7.4 while coanda environment on.
2. At the end of step 2, during compiling using: g++ hello_tf.cpp -ltensorflow, getting the error:

/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 1603 (>= sh_info of 1)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2710 (>= sh_info of 1)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2711 (>= sh_info of 1)

But while executing giving me the output: Hello from TensorFlow C library version 1.15.0

  1. In running the step 1 of ML_RANS: python ML_Model.py gives me error:
Traceback (most recent call last):
  File "ML_Model.py", line 5, in <module>
    import tensorflow as tf

Could you please help.

@chandukec
Copy link
Author

chandukec commented Dec 15, 2021

Hello, Sorry for the multiple posts, for the issue 1 getting after pip install -r requirements.txt
I managed to forcefully install the terminado using pip install terminado==0.8.3 --user --ignore-installed
and then when trying to python ML_Model.py, I am getting the errors:

WARNING: Logging before flag parsing goes to stderr.
W1215 16:02:43.129057 140239487671168 module_wrapper.py:139] From ML_Model.py:13: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.

W1215 16:02:45.213897 140239487671168 deprecation.py:506] From /home/csp/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Traceback (most recent call last):
  File "ML_Model.py", line 158, in <module>
    model = get_model(num_inputs,num_outputs,6,40)
  File "ML_Model.py", line 68, in get_model
    keras.utils.plot_model(model, 'ml_model.png', show_shapes=True)
  File "/home/csp/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/vis_utils.py", line 283, in plot_model
    dpi=dpi)
  File "/home/csp/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/vis_utils.py", line 102, in model_to_dot
    if not check_pydot():
  File "/home/csp/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/vis_utils.py", line 50, in check_pydot
    pydot.Dot.create(pydot.Dot())
  File "/home/csp/anaconda3/lib/python3.7/site-packages/pydotplus/graphviz.py", line 1960, in create
    'GraphViz\'s executables not found')

Could you kindly help?

@Romit-Maulik
Copy link
Member

Can you try running the same python script but uncomment keras.utils.plot_model(model, 'ml_model.png', show_shapes=True) - it looks like you don't have GraphViz on your machine.

@chandukec
Copy link
Author

Hello Romit,
Many thanks for your prompt reply and help, I commented it, and it worked. But in the last step when I am trying to the RANS case using the simpleFoam_ML in Testing, I am getting the following error:

2021-12-16 09:07:54.970500: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2021-12-16 09:07:55.013029: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3499910000 Hz
2021-12-16 09:07:55.014298: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x56211c521560 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-12-16 09:07:55.014346: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
/* Value of relative step height (hh_) is */1.9
*** stack smashing detected ***: terminated

Could you please help further? Also if I wanted to run the LES case, what needs to be done, since in the README.md pdf it is mentioned that work in progress.

@Romit-Maulik
Copy link
Member

Hmm - I have never seen that error - it may be related to the use of OpenFOAM v 1906 instead of OpenFOAM 5. I believe there were some other issues (although they never had that specific error).

@chandukec
Copy link
Author

To have a fresh start, I tried to repeat the instructions, and instead of installing TensorFlow C library version 1.15.0 I tried to install the TensorFlow C library version 2.7.0-dev20211101, thereby I am getting no warning while executing g++ hello_tf.cpp -ltensorflow. Now, while trying to generate the data using python training_data_maker.py I am getting the following error:

Velocity reader file
Traceback (most recent call last):
  File "training_data_maker.py", line 58, in <module>
    U = read_vector(f'U_{i}')
  File "training_data_maker.py", line 32, in read_vector
    file = open(filename,'r')
FileNotFoundError: [Errno 2] No such file or directory: 'U_1'

I guess instead of generating the data, Total_dataset.npy is already there in OF_Data, should I use that ? Inside the training_data_marker.py , is the code reads and writes NumPy error corresponding to the cases of varying height and not with varying velocities? What are the cx and cy scalars in the code? Sorry for the multiple queries, but wanted to understand so that I could implement this for our case study, hope you understand.

@Romit-Maulik
Copy link
Member

Yes the training dataset is already available in Total_dataset.npy for different heights. The cx, cy scalars correspond the x,y coordinates in the computational domain.

@chandukec
Copy link
Author

Hello, I tried again but unfortunately got a similar kind of error (a bit changed):

2021-12-19 08:27:05.455261: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
/* Value of relative step height (hh_) is */1.9
*** stack smashing detected ***: terminated

@chandukec
Copy link
Author

Hi again, maybe I am not able to compile the ML turbulence model correctly, in Step 3: Compile ML turbulence model , using wclean && wmake libso I am getting the warnings/errors:

Making dependency list for source file tf_utils.C
wmkdepend: parse error while scanning 'tf_utils.H' ... perhaps missing a final newline
wmkdepend: parse error while scanning 'tf_utils.C' ... perhaps missing a final newline
Making dependency list for source file maketurbulentTransportModels.C
wmkdepend: parse error while scanning 'tf_utils.H' ... perhaps missing a final newline
wmkdepend: parse error while scanning 'maketurbulentTransportModels.C' ... perhaps missing a final newline

However, I managed to get the ML_SA_CG.so file in $FOAM_USER_LIBBIN
Is this which could be causing the error? Any help/suggestions ?

@Romit-Maulik
Copy link
Member

Yes - this looks like a version issue - are you still trying this on OpenFOAM v 1906?

@chandukec
Copy link
Author

Yes, I am using OF v 1906, but if I remember correctly then I managed to work this utility perfectly using your help in #6
but I am not sure what had changed-- an only thing which I noticed had changed is the Ubuntu version from 18 to 20.

@chandukec
Copy link
Author

To start afresh, I am trying to re-install this utility. In step 2 of README.md inside TensorFlowFoam-master/ML_RANS, when I am trying to wmake I am getting the following error:

Making dependency list for source file tf_utils.C
wmkdepend: parse error while scanning 'tf_utils.H' ... perhaps missing a final newline
wmkdepend: parse error while scanning 'tf_utils.C' ... perhaps missing a final newline
Making dependency list for source file maketurbulentTransportModels.C
wmkdepend: parse error while scanning 'tf_utils.H' ... perhaps missing a final newline
wmkdepend: parse error while scanning 'maketurbulentTransportModels.C' ... perhaps missing a final newline

Could you kindly help in this regard?

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