lu-group/sbinn

No module named 'tensorflow.python'

Soothysay opened this issue · 1 comments

Hi Professor @lululxvi,
I was trying to run the codes. However, as I was running sbinn_pytorch.py, I got the following error:

Output from spyder call 'get_namespace_view':
Using backend: tensorflow.compat.v1

Traceback (most recent call last):

  File "C:\Users\akash\Desktop\SBINN\sbinn_pytorch.py", line 9, in <module>
    import deepxde as dde

  File "C:\Users\akash\anaconda3\lib\site-packages\deepxde\__init__.py", line 4, in <module>
    from . import backend

  File "C:\Users\akash\anaconda3\lib\site-packages\deepxde\backend\__init__.py", line 85, in <module>
    load_backend(get_preferred_backend())

  File "C:\Users\akash\anaconda3\lib\site-packages\deepxde\backend\__init__.py", line 30, in load_backend
    mod = importlib.import_module(".%s" % mod_name.replace(".", "_"), __name__)

  File "C:\Users\akash\anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)

  File "C:\Users\akash\anaconda3\lib\site-packages\deepxde\backend\tensorflow_compat_v1\__init__.py", line 5, in <module>
    from .tensor import *  # pylint: disable=redefined-builtin

  File "C:\Users\akash\anaconda3\lib\site-packages\deepxde\backend\tensorflow_compat_v1\tensor.py", line 4, in <module>
    import tensorflow.compat.v1 as tf

  File "C:\Users\akash\anaconda3\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util

ModuleNotFoundError: No module named 'tensorflow.python' 

It necessarily isn't an issue relating to SBINNs, but might be one related to DeepXDE. Can you provide some insight on this and maybe a possible solution to mitigate this issue?

Best,
Akash.

You are using the tensorflow.compat.v1 backend of DeepXDE. If running the sbinn_pytorch.py file, make sure you set the DeepXDE backend to Pytorch. If you need help changing the backend see https://deepxde.readthedocs.io/en/latest/user/installation.html. Alternatively, since you are already using the tensorflow.compat.v1 backend you can run the sbinn_tf.py file.