deepsphere / deepsphere-cosmo-tf2

A spherical convolutional neural network for cosmology (TFv2).
https://arxiv.org/abs/1810.12186
MIT License
19 stars 5 forks source link

Conda install deeps-here #9

Closed aavigliano closed 9 months ago

aavigliano commented 9 months ago

I created a conda environment, activated it and installed pip in it; I then followed steps 1 and 2 in https://github.com/deepsphere/deepsphere-cosmo-tf2, but it returns

" note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for scipy Building wheel for PyGSP (setup.py) ... done Created wheel for PyGSP: filename=PyGSP-0.5.1-py3-none-any.whl size=1886744 sha256=622eda0ca58242241bf95de9e2aac471594f6db650332a7def884a07cd1d967c Stored in directory: /private/var/folders/5l/8sxy3dbs4_sbyqdhz5g0tv2w0000gn/T/pip-ephem-wheel-cac he-1xrlcgi6/wheels/02/45/86/e3968e70e73a8a08f3f802ca85992fede12b1a01485f22f3 29 Successfully built PyGSP Failed to build scipy ERROR: Could not build wheels for scipy, which is required to install pyproject.toml-based projects "

Installing scipy by hand doesn't solve the problem. What can I do? The python version is 3.11.5

aavigliano commented 9 months ago

I just tried the installation with a different version of python (3.10). The installation worked fine this time, but when I tried "pytest tests" I got a pletora of error messages:

" ======================================= test session starts ======================================= platform darwin -- Python 3.10.12, pytest-7.4.2, pluggy-1.3.0 rootdir: /Users/aviglian/deepsphere-cosmo-tf2 collected 0 items / 5 errors

============================================= ERRORS ============================================== ____ ERROR collecting tests/test_gnn_layers.py ____ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_gnn_layers.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_gnn_layers.py:6: in from deepsphere import gnn_layers E ModuleNotFoundError: No module named 'deepsphere' ----------------------------------------- Captured stderr ----------------------------------------- 2023-10-03 09:36:39.155660: I tensorflow/core/platform/cpu_featureguard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. ____ ERROR collecting tests/test_gnntransformers.py ____ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_gnn_transformers.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_gnn_transformers.py:7: in from deepsphere import gnn_transformers E ModuleNotFoundError: No module named 'deepsphere' __ ERROR collecting tests/test_healpy_layers.py _____ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_healpy_layers.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_healpy_layers.py:6: in from deepsphere import healpylayers E ModuleNotFoundError: No module named 'deepsphere' ____ ERROR collecting tests/test_healpy_networks.py __ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_healpy_networks.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_healpy_networks.py:10: in from deepsphere import healpy_layers as hp_nn E ModuleNotFoundError: No module named 'deepsphere' __ ERROR collecting tests/test_utils.py ___ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_utils.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_utils.py:4: in from deepsphere import utils E ModuleNotFoundError: No module named 'deepsphere' ======================================== warnings summary ========================================= ../../../opt/anaconda3/envs/deepsphere/lib/python3.10/site-packages/tensorflow/python/framework/dtypes.py:35 /opt/anaconda3/envs/deepsphere/lib/python3.10/site-packages/tensorflow/python/framework/dtypes.py:35: DeprecationWarning: ml_dtypes.float8_e4m3b11 is deprecated. Use ml_dtypes.float8_e4m3b11fnuz from tensorflow.tsl.python.lib.core import pywrap_ml_dtypes

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ===================================== short test summary info ===================================== ERROR tests/test_gnn_layers.py ERROR tests/test_gnn_transformers.py ERROR tests/test_healpy_layers.py ERROR tests/test_healpy_networks.py ERROR tests/test_utils.py !!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 5 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============================= 1 warning, 5 errors in 60.38s (0:01:00) =============================

" What can I do?

jafluri commented 9 months ago

Hello,

Thanks for your interest in deepsphere.

I just ran some tests, the installation should work with python 3.10, so if you don't mind downgrading, you can try it in a new environment. The problem with python 3.11.5 is that the scipy version 1.8 which is used in previous python installations does not exist, so it tries an even older one which fails. However, I just checked with the most recent scipy and at least the tests run through. So you could change the line in requirements from scipy<=1.8 to just scipy and try again.

jafluri commented 9 months ago

I just tried the installation with a different version of python (3.10). The installation worked fine this time, but when I tried "pytest tests" I got a pletora of error messages:

" ======================================= test session starts ======================================= platform darwin -- Python 3.10.12, pytest-7.4.2, pluggy-1.3.0 rootdir: /Users/aviglian/deepsphere-cosmo-tf2 collected 0 items / 5 errors

============================================= ERRORS ============================================== ____ ERROR collecting tests/test_gnn_layers.py ____ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_gnn_layers.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_gnn_layers.py:6: in from deepsphere import gnn_layers E ModuleNotFoundError: No module named 'deepsphere' ----------------------------------------- Captured stderr ----------------------------------------- 2023-10-03 09:36:39.155660: I tensorflow/core/platform/cpu_featureguard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. ____ ERROR collecting tests/test_gnntransformers.py ____ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_gnn_transformers.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_gnn_transformers.py:7: in from deepsphere import gnn_transformers E ModuleNotFoundError: No module named 'deepsphere' __ ERROR collecting tests/test_healpy_layers.py ___ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_healpy_layers.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_healpy_layers.py:6: in from deepsphere import healpylayers E ModuleNotFoundError: No module named 'deepsphere' ____ ERROR collecting tests/test_healpy_networks.py __ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_healpy_networks.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_healpy_networks.py:10: in from deepsphere import healpy_layers as hp_nn E ModuleNotFoundError: No module named 'deepsphere' __ ERROR collecting tests/test_utils.py ___ ImportError while importing test module '/Users/aviglian/deepsphere-cosmo-tf2/tests/test_utils.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/anaconda3/envs/deepsphere/lib/python3.10/importlib/init.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_utils.py:4: in from deepsphere import utils E ModuleNotFoundError: No module named 'deepsphere' ======================================== warnings summary ========================================= ../../../opt/anaconda3/envs/deepsphere/lib/python3.10/site-packages/tensorflow/python/framework/dtypes.py:35 /opt/anaconda3/envs/deepsphere/lib/python3.10/site-packages/tensorflow/python/framework/dtypes.py:35: DeprecationWarning: ml_dtypes.float8_e4m3b11 is deprecated. Use ml_dtypes.float8_e4m3b11fnuz from tensorflow.tsl.python.lib.core import pywrap_ml_dtypes

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ===================================== short test summary info ===================================== ERROR tests/test_gnn_layers.py ERROR tests/test_gnn_transformers.py ERROR tests/test_healpy_layers.py ERROR tests/test_healpy_networks.py ERROR tests/test_utils.py !!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 5 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============================= 1 warning, 5 errors in 60.38s (0:01:00) =============================

" What can I do?

Looks like you forgot the pip install -e . step.

aavigliano commented 9 months ago

You are right, I forgot it. Now it looks like is working, thank you!

" ============================================ test session starts ============================================= platform darwin -- Python 3.10.12, pytest-7.4.2, pluggy-1.3.0 rootdir: /Users/aviglian/deepsphere-cosmo-tf2 collected 15 items

tests/test_gnn_layers.py .... [ 26%] tests/test_gnn_transformers.py .. [ 40%] tests/test_healpy_layers.py ...... [ 80%] tests/test_healpy_networks.py .. [ 93%] tests/test_utils.py . [100%]

============================================== warnings summary ============================================== ../../../opt/anaconda3/envs/deepsphere/lib/python3.10/site-packages/tensorflow/python/framework/dtypes.py:35 /opt/anaconda3/envs/deepsphere/lib/python3.10/site-packages/tensorflow/python/framework/dtypes.py:35: DeprecationWarning: ml_dtypes.float8_e4m3b11 is deprecated. Use ml_dtypes.float8_e4m3b11fnuz from tensorflow.tsl.python.lib.core import pywrap_ml_dtypes

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================================= 15 passed, 1 warning in 41.80s =======================================

"

jafluri commented 9 months ago

Lgtm! If there are any more problems, don't hesitate to open another issue.