kappazeta / km_predict

S2 full image prediction
Apache License 2.0
21 stars 9 forks source link

Conda environment broken #24

Closed indrek-sunter closed 1 year ago

indrek-sunter commented 1 year ago

Created a new Conda environment today and got the following error while running km_predict:

2023-01-19 20:35:13.526596: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/framework/dtypes.py:513: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  np.object,
Traceback (most recent call last):
  File "/home/sussch/Documents/projects/kz/cloudmask/km_predict/km_predict.py", line 22, in <module>
    from architectures import ARCH_MAP
  File "/home/sussch/Documents/projects/kz/cloudmask/km_predict/architectures.py", line 18, in <module>
    import tensorflow as tf
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/__init__.py", line 46, in <module>
    from tensorflow.python import data
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/data/__init__.py", line 25, in <module>
    from tensorflow.python.data import experimental
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/data/experimental/__init__.py", line 96, in <module>
    from tensorflow.python.data.experimental import service
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/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 "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/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 "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/data/experimental/ops/compression_ops.py", line 20, in <module>
    from tensorflow.python.data.util import structure
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/data/util/structure.py", line 26, in <module>
    from tensorflow.python.data.util import nest
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/data/util/nest.py", line 41, in <module>
    from tensorflow.python.framework import sparse_tensor as _sparse_tensor
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/framework/sparse_tensor.py", line 29, in <module>
    from tensorflow.python.framework import constant_op
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/framework/constant_op.py", line 29, in <module>
    from tensorflow.python.eager import execute
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/eager/execute.py", line 27, in <module>
    from tensorflow.python.framework import dtypes
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/tensorflow/python/framework/dtypes.py", line 513, in <module>
    np.object,
  File "/home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'object'

Tensorflow version is 2.4.1 and numpy version 1.24.1.

indrek-sunter commented 1 year ago

After fixing numpy to <= 1.23.4, another issue popped up, this time in rasterio.

ImportError: /home/sussch/miniconda3/envs/km_predict/lib/python3.9/site-packages/rasterio/../../../libgdal.so.26: undefined symbol: _ZNK6libdap5Error17get_error_messageB5cxx11Ev
indrek-sunter commented 1 year ago

Seems to be working after explicitly asking rasterio to be installed from conda-forge.