gitter-lab / nn4dms

Neural networks for deep mutational scanning data
MIT License
66 stars 16 forks source link

absl-py version #6

Closed codon-consulting closed 10 months ago

codon-consulting commented 11 months ago

Hi! Just a heads-up that after a fresh installation with micromamba and environment.yml, I was only able to make the regression.py script run after installing absl-py==0.7.0.

With the fresh installation, I got the following trace:

/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
  File "code/regression.py", line 19, in <module>
    import tensorflow as tf
  File "/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/__init__.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 63, in <module>
    from tensorflow.python.framework.framework_lib import *  # pylint: disable=redefined-builtin
  File "/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/framework/framework_lib.py", line 25, in <module>
    from tensorflow.python.framework.ops import Graph
  File "/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 54, in <module>
    from tensorflow.python.platform import app
  File "/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 23, in <module>
    from absl.app import run as _run
  File "/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/absl/app.py", line 37, in <module>
    from absl import flags
  File "/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/absl/flags/__init__.py", line 35, in <module>
    from absl.flags import _argument_parser
  File "/PROJECTS/user_profiles/mikael/micromamba/envs/nn4dms/lib/python3.6/site-packages/absl/flags/_argument_parser.py", line 82, in <module>
    class ArgumentParser(Generic[_T], metaclass=_ArgumentParserCache):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
agitter commented 11 months ago

Thanks for notifying us. We can also pin absl-py in our environment files.

I'm surprised that our GitHub actions workflow didn't fail when it last ran two weeks ago. It creates a fresh conda environment and runs regression.py. I'll check what version of absl-py it was using before pinning it.

agitter commented 11 months ago

@codon-consulting I did some testing in #7 and wonder if mamba has something to do with the problem you encountered. When I switched to mamba to install the environment, the installation failed entirely. It worked again with conda, and conda selected absl-py 0.15.0. I've pinned that version in the environment file now so that hopefully others won't run into this problem.

codon-consulting commented 11 months ago

Interesting, the thought crossed my mind but I didn't test it. Thanks for checking and fixing!