kundajelab / fastISM

In-silico Saturation Mutagenesis implementation with 10x or more speedup for certain architectures.
MIT License
18 stars 3 forks source link

ImportError when importing fastism in TF2.8 #11

Closed kiramt closed 2 years ago

kiramt commented 2 years ago

Hi Surag

Something seems to have broken when using fastism with TF2.8. When importing fastism I get an ImportError:

> python                                                                                                                                                                               15:23:50
Python 3.9.9 (main, Nov 21 2021, 03:23:42)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fastism
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "../.venv/lib/python3.9/site-packages/fastism/__init__.py", line 1, in <module>
    from .fast_ism import FastISM
  File "../.venv/lib/python3.9/site-packages/fastism/fast_ism.py", line 2, in <module>
    from .fast_ism_utils import generate_models
  File "../.venv/lib/python3.9/site-packages/fastism/fast_ism_utils.py", line 2, in <module>
    from . import flatten_model
  File "../.venv/lib/python3.9/site-packages/fastism/flatten_model.py", line 2, in <module>
    from tensorflow.python.keras.layers import wrappers
ImportError: cannot import name 'wrappers' from 'tensorflow.python.keras.layers' (../.venv/lib/python3.9/site-packages/tensorflow/python/keras/layers/__init__.py)
>>> import tensorflow
>>> tensorflow.__version__
'2.8.0'

It looks like it's probably this change

kiramt commented 2 years ago

Not clear if the import is being used in fastism though?

suragnair commented 2 years ago

Thanks, indeed they aren't being used. I have removed them and updated to version 0.5.1.