juglab / cryoCARE_pip

PIP package of cryoCARE
BSD 3-Clause "New" or "Revised" License
25 stars 14 forks source link

numpy versions in conflict.... tensorflow vs cryoCARE #47

Closed pconesa closed 1 year ago

pconesa commented 1 year ago

Hi, after installing cuda 11 environment.... pip is reporting this:

tensorflow 2.4.0 requires numpy~=1.19.2, but you have numpy 1.24.3 which is incompatible.

When importing tensorflow of this environment I get this:

(cryocare_11) pablo@youyou ~/software/forticlientsslvpn $ python
Python 3.8.16 | packaged by conda-forge | (default, Feb  1 2023, 16:01:55) 
[GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
2023-04-24 13:33:32.362628: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/framework/dtypes.py:513: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
  np.object,
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/__init__.py", line 46, in <module>
    from tensorflow.python import data
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/data/__init__.py", line 25, in <module>
    from tensorflow.python.data import experimental
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/data/experimental/__init__.py", line 96, in <module>
    from tensorflow.python.data.experimental import service
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/data/experimental/service/__init__.py", line 140, in <module>
    from tensorflow.python.data.experimental.ops.data_service_ops import distribute
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/data/experimental/ops/data_service_ops.py", line 25, in <module>
    from tensorflow.python.data.experimental.ops import compression_ops
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/data/experimental/ops/compression_ops.py", line 20, in <module>
    from tensorflow.python.data.util import structure
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/data/util/structure.py", line 26, in <module>
    from tensorflow.python.data.util import nest
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/data/util/nest.py", line 41, in <module>
    from tensorflow.python.framework import sparse_tensor as _sparse_tensor
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/framework/sparse_tensor.py", line 29, in <module>
    from tensorflow.python.framework import constant_op
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 29, in <module>
    from tensorflow.python.eager import execute
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/eager/execute.py", line 27, in <module>
    from tensorflow.python.framework import dtypes
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/tensorflow/python/framework/dtypes.py", line 513, in <module>
    np.object,
  File "/extra/miniconda3/envs/cryocare_11/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
pconesa commented 1 year ago

Probably fixing the numpy in cryoCARE to numpy~=1.19.2 might fix it or increasing the tensorflow version in the documentation ?

pconesa commented 1 year ago

After, downgrading numpy to: pip install numpy==1.19.2

and then scipy to : pip install scipy==1.9.3

tensorflow does not complain and detects my GPU... haven't gone further.

pconesa commented 1 year ago

more data....

installing matplotlib<=3.63

Does not force the installation of numpy >=1.20.

McHaillet commented 1 year ago

Hi! I ran into the same problem. I made a PR that specifies the numpy version in the setup.py.

thorstenwagner commented 1 year ago

I hope that this is fixed with the latest 0.3.0 version. Otherwise reopen.