Evoland-Land-Monitoring-Evolution / sentinel2_superresolution

Super-resolution of 10 Sentinel-2 bands to 5-meter resolution, starting from L1C or L2A (Theia format) products.
Apache License 2.0
52 stars 7 forks source link

Error when trying to install gpu version #2

Closed firmanhadi closed 2 months ago

firmanhadi commented 3 months ago

Hi, I got this error message when I tried to install gpu version:

Running command git clone --filter=blob:none --quiet 'https://framagit.org/jmichel-otb/sentinel2_superresolution.git[gpu]' /tmp/pip-req-build-h3wkpcmt
  fatal: unable to update url base from redirection:
    asked for: https://framagit.org/jmichel-otb/sentinel2_superresolution.git[gpu]/info/refs?service=git-upload-pack
     redirect: https://framagit.org/users/sign_in
  error: subprocess-exited-with-error
jmichel-otb commented 3 months ago

Can you try:

$ git clone https://framagit.org/jmichel-otb/sentinel2_superresolution.git
$ pip install sentinel2_superresolution[gpu]
firmanhadi commented 3 months ago

Can you try:

$ git clone https://framagit.org/jmichel-otb/sentinel2_superresolution.git
$ pip install sentinel2_superresolution[gpu]

Thank you for prompt reply. I could proceed to install it, but a new error came when I ran one of the example. Screenshot from 2024-04-29 19-01-34

jmichel-otb commented 3 months ago

What is your python version ? I think 3.10 is required for this syntax.

firmanhadi commented 3 months ago

What is your python version ? I think 3.10 is required for this syntax.

Thank you. After I used Python 3.10, I could install it. Another error came after I tried to run it with this command: sentinel2_superesolution -i S2A_MSIL2A_20240319T025531_N0510_R032_T48MYU_20240319T072558.SAFE -o resumts/ --gpu

File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sensorsio/sentinel2.py", line 404, in build_xml_path raise FileNotFoundError( FileNotFoundError: Could not find root XML file in product directory S2A_MSIL2A_20240319T025531_N0510_R032_T48MYU_20240319T072558.SAFE

nyinyinyanlin commented 3 months ago

I had the same problem with pip install git+https combination with the installation redirected to https://framagit.org/users/sign_in when supplied [gpu] support variant.o

firmanhadi commented 3 months ago

What is your python version ? I think 3.10 is required for this syntax.

Thank you. After I used Python 3.10, I could install it. Another error came after I tried to run it with this command: sentinel2_superesolution -i S2A_MSIL2A_20240319T025531_N0510_R032_T48MYU_20240319T072558.SAFE -o resumts/ --gpu

File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sensorsio/sentinel2.py", line 404, in build_xml_path raise FileNotFoundError( FileNotFoundError: Could not find root XML file in product directory S2A_MSIL2A_20240319T025531_N0510_R032_T48MYU_20240319T072558.SAFE

I realized I didn't use the correct version of Sentinel-2A Product. I downloaded Sentinel-2A MAJA product from DLR, but when I ran it again, there was a new error message:

sentinel2_superesolution -i SENTINEL2B_20240418-103602-534_L2A_T32UNE_C_V1-3 -o resumts/ --gpu Traceback (most recent call last): File "/home/firman/anaconda3/envs/super/bin/sentinel2_superesolution", line 8, in <module> sys.exit(run()) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/run.py", line 424, in run main(sys.argv[1:]) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/run.py", line 281, in main ort_session = ort.InferenceSession(args.model, sess_options=so, providers=ep_list) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in __init__ self._create_inference_session(providers, provider_options, disabled_optimizers) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 472, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from /home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/../../models/carn_3x3x64g4sw_bootstrap.onnx failed:Load model /home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/../../models/carn_3x3x64g4sw_bootstrap.onnx failed. File doesn't exist

firmanhadi commented 3 months ago

I had the same problem with pip install git+https combination with the installation redirected to https://framagit.org/users/sign_in when supplied [gpu] support variant.o

You can use the solution by @jmichel-otb https://github.com/Evoland-Land-Monitoring-Evolution/sentinel2_superresolution/issues/2#issuecomment-2082311191

jmichel-otb commented 3 months ago

I realized I didn't use the correct version of Sentinel-2A Product. I downloaded Sentinel-2A MAJA product from DLR, but when I ran it again, there was a new error message:

Yes, supporting sen2corr L2A is only a matter of adding support in sensorsio. Should be available in a few weeks / months.

sentinel2_superesolution -i SENTINEL2B_20240418-103602-534_L2A_T32UNE_C_V1-3 -o resumts/ --gpu Traceback (most recent call last): File "/home/firman/anaconda3/envs/super/bin/sentinel2_superesolution", line 8, in <module> sys.exit(run()) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/run.py", line 424, in run main(sys.argv[1:]) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/run.py", line 281, in main ort_session = ort.InferenceSession(args.model, sess_options=so, providers=ep_list) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in __init__ self._create_inference_session(providers, provider_options, disabled_optimizers) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 472, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from /home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/../../models/carn_3x3x64g4sw_bootstrap.onnx failed:Load model /home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/../../models/carn_3x3x64g4sw_bootstrap.onnx failed. File doesn't exist

Ok, so there is still a problem with installation, the model file does not get installed with pip install. Sorry about the crappy packaging, I need to improve it.

Meanwhile, could you try running again:

$ git clone https://framagit.org/jmichel-otb/sentinel2_superresolution.git
$ pip install -e sentinel2_superresolution[gpu]

Or alternatively provide the model explicitly to the command-line:

$ sentinel2_superesolution -i SENTINEL2B_20240418-103602-534_L2A_T32UNE_C_V1-3 -o resumts/ --gpu -m path_to/carn_3x3x64g4sw_bootstrap.onnx

The carn_3x3x64g4sw_bootstrap.onnx model file is located in the models folder of the source of sentinel2_superresolution.

safalabolo commented 3 months ago

Hi @jmichel-otb, thnak you for your quick reply. Unfortunately, a new error occurs again.

sentinel2_superesolution -v -i /mnt/hd/appoggio2/test/S2B_MSIL1C_20230823T095559_N0509_R122_T33TUG_20230823T121626.SAFE/ --l1c -o out/ --gpu -m /test/carn_3x3x64g4sw_bootstrap.onnx Traceback (most recent call last): File "/usr/local/bin/sentinel2_superesolution", line 5, in from sentinel2_superresolution.run import run File "/root/miniconda3/lib/python3.10/site-packages/sentinel2_superresolution/run.py", line 15, in from sensorsio.sentinel2 import Sentinel2 File "/root/miniconda3/lib/python3.10/site-packages/sensorsio/sentinel2.py", line 27, in import geopandas as gpd File "/mnt/hd/safalabolo/.local/lib/python3.10/site-packages/geopandas/init.py", line 1, in from geopandas._config import options File "/mnt/hd/safalabolo/.local/lib/python3.10/site-packages/geopandas/_config.py", line 109, in default_value=_default_use_pygeos(), File "/mnt/hd/safalabolo/.local/lib/python3.10/site-packages/geopandas/_config.py", line 95, in _default_use_pygeos import geopandas._compat as compat File "/mnt/hd/safalabolo/.local/lib/python3.10/site-packages/geopandas/_compat.py", line 242, in import rtree # noqa: F401 File "/root/miniconda3/lib/python3.10/site-packages/rtree/init.py", line 9, in from .index import Index, Rtree # noqa File "/root/miniconda3/lib/python3.10/site-packages/rtree/index.py", line 17, in from . import core File "/root/miniconda3/lib/python3.10/site-packages/rtree/core.py", line 74, in rt = finder.load() File "/root/miniconda3/lib/python3.10/site-packages/rtree/finder.py", line 79, in load cwd = os.getcwd() FileNotFoundError: [Errno 2] No such file or directory

firmanhadi commented 3 months ago

I realized I didn't use the correct version of Sentinel-2A Product. I downloaded Sentinel-2A MAJA product from DLR, but when I ran it again, there was a new error message:

Yes, supporting sen2corr L2A is only a matter of adding support in sensorsio. Should be available in a few weeks / months.

sentinel2_superesolution -i SENTINEL2B_20240418-103602-534_L2A_T32UNE_C_V1-3 -o resumts/ --gpu Traceback (most recent call last): File "/home/firman/anaconda3/envs/super/bin/sentinel2_superesolution", line 8, in <module> sys.exit(run()) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/run.py", line 424, in run main(sys.argv[1:]) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/run.py", line 281, in main ort_session = ort.InferenceSession(args.model, sess_options=so, providers=ep_list) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in __init__ self._create_inference_session(providers, provider_options, disabled_optimizers) File "/home/firman/anaconda3/envs/super/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 472, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from /home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/../../models/carn_3x3x64g4sw_bootstrap.onnx failed:Load model /home/firman/anaconda3/envs/super/lib/python3.10/site-packages/sentinel2_superresolution/../../models/carn_3x3x64g4sw_bootstrap.onnx failed. File doesn't exist

Ok, so there is still a problem with installation, the model file does not get installed with pip install. Sorry about the crappy packaging, I need to improve it.

Meanwhile, could you try running again:

$ git clone https://framagit.org/jmichel-otb/sentinel2_superresolution.git
$ pip install -e sentinel2_superresolution[gpu]

Or alternatively provide the model explicitly to the command-line:

$ sentinel2_superesolution -i SENTINEL2B_20240418-103602-534_L2A_T32UNE_C_V1-3 -o resumts/ --gpu -m path_to/carn_3x3x64g4sw_bootstrap.onnx

The carn_3x3x64g4sw_bootstrap.onnx model file is located in the models folder of the source of sentinel2_superresolution.

I have finally succeeded to run it and get the result. super

jmichel-otb commented 2 months ago

Packaging is fixed and installation instruction have been simplified in README.