nasa-nccs-hpda / tensorflow-caney

Python framework for lots of geospatial TensorFlow tools
https://nasa-nccs-hpda.github.io/tensorflow-caney
Apache License 2.0
4 stars 0 forks source link

Fix GDAL installation in the Container #75

Open jordancaraballo opened 3 weeks ago

jordancaraballo commented 3 weeks ago

We are experiencing the following problem https://github.com/rspatial/terra/issues/1378 within the container.

jordancaraballo commented 3 weeks ago

The current latest tag has this error. Error and steps to reproduce below:

(ilab-pytorch) [jacaraba@gpu022 v2]$ singularity shell --nv -B /explore/nobackup/people,/explore/nobackup/projects,/css,/nfs4m,/tmp /lscratch/jacaraba/container/tensorflow-caney
WARNING: underlay of /etc/localtime required more than 50 (115) bind mounts
WARNING: underlay of /usr/bin/nvidia-smi required more than 50 (665) bind mounts
15:4: not a valid test operator:
15:4: not a valid test operator: 12.6
21:4: not a valid test operator: (
21:4: not a valid test operator: 560.35.03
Singularity> python
Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> src = rasterio.open('/explore/nobackup/projects/ilab/projects/srlite/input/Alaska/WV02_20180902_M1BS_10300100818A1100-toa.tif')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'rasterio' is not defined
>>> import rasterio
>>> src = rasterio.open('/explore/nobackup/projects/ilab/projects/srlite/input/Alaska/WV02_20180902_M1BS_10300100818A1100-toa.tif')
>>> src.meta
ERROR 1: PROJ: internal_proj_identify: /usr/share/proj/proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 2 whereas a number >= 3 is expected. It comes from another PROJ installation.
{'driver': 'GTiff', 'dtype': 'int16', 'nodata': -9999.0, 'width': 11115, 'height': 60127, 'count': 8, 'crs': CRS.from_wkt('PROJCS["WGS 84 / UTM zone 5N",GEOGCS["WGS 84",DATUM["World Geodetic System 1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'), 'transform': Affine(2.0, 0.0, 396151.0,
       0.0, -2.0, 6656429.0)}
jordancaraballo commented 3 weeks ago

Easier command and error output. The fixed statement should not include "ERROR 1: PROJ:".

(ilab-pytorch) [jacaraba@gpu022 v2]$ singularity exec --nv -B /explore/nobackup/people,/explore/nobackup/projects,/css,/nfs4m,/tmp /lscratch/jacaraba/container/tensorflow-caney python -c "import rasterio; src = rasterio.open('/explore/nobackup/projects/ilab/projects/srlite/input/Alaska/WV02_20180902_M1BS_10300100818A1100-toa.tif'); print(src.meta)"
WARNING: underlay of /etc/localtime required more than 50 (115) bind mounts
WARNING: underlay of /usr/bin/nvidia-smi required more than 50 (665) bind mounts
15:4: not a valid test operator:  
15:4: not a valid test operator: 12.6
21:4: not a valid test operator: (
21:4: not a valid test operator: 560.35.03
ERROR 1: PROJ: internal_proj_identify: /usr/share/proj/proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 2 whereas a number >= 3 is expected. It comes from another PROJ installation.
{'driver': 'GTiff', 'dtype': 'int16', 'nodata': -9999.0, 'width': 11115, 'height': 60127, 'count': 8, 'crs': CRS.from_wkt('PROJCS["WGS 84 / UTM zone 5N",GEOGCS["WGS 84",DATUM["World Geodetic System 1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-153],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'), 'transform': Affine(2.0, 0.0, 396151.0,
       0.0, -2.0, 6656429.0)}
jordancaraballo commented 3 weeks ago

@cssprad1 Take a look at this.

jordancaraballo commented 3 days ago

Found the fix, copy and paste from the ilab-container.