limap icon indicating copy to clipboard operation
limap copied to clipboard

Docker build error when installing pytorch

Open AustrianOakvn opened this issue 9 months ago • 3 comments

First, thank you for the great work. I'm trying to install limap by docker but currently there are issues with my buid. When i ran the build with the Dockerfile provided in the repo, i encountered No matching distribution found for torch==1.12.0

 => CACHED [stage-1 14/16] COPY --from=intermediate /limap /limap                                                                                                            0.0s
 => ERROR [stage-1 15/16] RUN python -m pip install torch==1.12.0 torchvision==0.13.0 --index-url https://download.pytorch.org/whl/cu115                                     2.7s
------
 > [stage-1 15/16] RUN python -m pip install torch==1.12.0 torchvision==0.13.0 --index-url https://download.pytorch.org/whl/cu115:
0.527 Looking in indexes: https://download.pytorch.org/whl/cu115
1.780 ERROR: Could not find a version that satisfies the requirement torch==1.12.0 (from versions: 1.11.0+cu115)
1.780 ERROR: No matching distribution found for torch==1.12.0
------
Dockerfile:121
--------------------
 119 |     # Copy the repository from the first image
 120 |     COPY --from=intermediate /limap /limap
 121 | >>> RUN python -m pip install torch==1.12.0 torchvision==0.13.0 --index-url https://download.pytorch.org/whl/cu115
 122 |     # RUN python -m pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
 123 |     # RUN python -m pip install torch==1.11.0 torchvision==0.12.0 --index-url https://download.pytorch.org/whl/cu115
--------------------
ERROR: failed to solve: process "/bin/sh -c python -m pip install torch==1.12.0 torchvision==0.13.0 --index-url https://download.pytorch.org/whl/cu115" did not complete successfully: exit code: 1

Then i changed the torch version to torch==1.11.0 torchvision==0.12.0 similar to the previous commit. This time, there is build issue with the hawp, No module name torch.

=> CACHED [stage-1 15/16] RUN python -m pip install torch==1.11.0 torchvision==0.12.0 --index-url https://download.pytorch.org/whl/cu115                                    0.0s
 => ERROR [stage-1 16/16] RUN python -m pip install --upgrade pip setuptools &&     cd limap &&     python --version &&     pip --version &&     python -m pip install -r r  9.8s
------
 > [stage-1 16/16] RUN python -m pip install --upgrade pip setuptools &&     cd limap &&     python --version &&     pip --version &&     python -m pip install -r requirements.txt &&     python -m pip install -Ive .:
0.508 Requirement already satisfied: pip in /opt/venv/lib/python3.9/site-packages (23.0.1)
0.584 Collecting pip
0.639   Downloading pip-23.3.1-py3-none-any.whl (2.1 MB)
0.888      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 8.5 MB/s eta 0:00:00
0.896 Requirement already satisfied: setuptools in /opt/venv/lib/python3.9/site-packages (58.1.0)
1.075 Collecting setuptools
1.097   Downloading setuptools-68.2.2-py3-none-any.whl (807 kB)
1.179      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 807.9/807.9 kB 9.9 MB/s eta 0:00:00
1.274 Installing collected packages: setuptools, pip
1.274   Attempting uninstall: setuptools
1.274     Found existing installation: setuptools 58.1.0
1.313     Uninstalling setuptools-58.1.0:
1.396       Successfully uninstalled setuptools-58.1.0
1.682   Attempting uninstall: pip
1.683     Found existing installation: pip 23.0.1
1.823     Uninstalling pip-23.0.1:
1.962       Successfully uninstalled pip-23.0.1
2.660 Successfully installed pip-23.3.1 setuptools-68.2.2
2.779 Python 3.9.18
2.943 pip 23.3.1 from /opt/venv/lib/python3.9/site-packages/pip (python 3.9)
3.250 Processing ./third-party/pytlsd
3.254   Installing build dependencies: started
8.338   Installing build dependencies: finished with status 'done'
8.339   Getting requirements to build wheel: started
8.445   Getting requirements to build wheel: finished with status 'done'
8.447   Preparing metadata (pyproject.toml): started
8.564   Preparing metadata (pyproject.toml): finished with status 'done'
8.569 Processing ./third-party/hawp
8.572   Installing build dependencies: started
9.514   Installing build dependencies: finished with status 'done'
9.515   Getting requirements to build wheel: started
9.599   Getting requirements to build wheel: finished with status 'error'
9.603   error: subprocess-exited-with-error
9.603   
9.603   × Getting requirements to build wheel did not run successfully.
9.603   │ exit code: 1
9.603   ╰─> [17 lines of output]
9.603       Traceback (most recent call last):
9.603         File "/opt/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
9.603           main()
9.603         File "/opt/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
9.603           json_out['return_val'] = hook(**hook_input['kwargs'])
9.603         File "/opt/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
9.603           return hook(config_settings)
9.603         File "/tmp/pip-build-env-2apo2evk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
9.603           return self._get_build_requires(config_settings, requirements=['wheel'])
9.603         File "/tmp/pip-build-env-2apo2evk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
9.603           self.run_setup()
9.603         File "/tmp/pip-build-env-2apo2evk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 507, in run_setup
9.603           super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
9.603         File "/tmp/pip-build-env-2apo2evk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in run_setup
9.603           exec(code, locals())
9.603         File "<string>", line 4, in <module>
9.603       ModuleNotFoundError: No module named 'torch'
9.603       [end of output]
9.603   
9.603   note: This error originates from a subprocess, and is likely not a problem with pip.
9.604 error: subprocess-exited-with-error
9.604 
9.604 × Getting requirements to build wheel did not run successfully.
9.604 │ exit code: 1
9.604 ╰─> See above for output.
9.604 
9.604 note: This error originates from a subprocess, and is likely not a problem with pip.
------
Dockerfile:124
--------------------
 123 |     RUN python -m pip install torch==1.11.0 torchvision==0.12.0 --index-url https://download.pytorch.org/whl/cu115
 124 | >>> RUN python -m pip install --upgrade pip setuptools && \
 125 | >>>     cd limap && \
 126 | >>>     python --version && \
 127 | >>>     pip --version && \
 128 | >>>     python -m pip install -r requirements.txt && \
 129 | >>>     python -m pip install -Ive .
 130 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c python -m pip install --upgrade pip setuptools &&     cd limap &&     python --version &&     pip --version &&     python -m pip install -r requirements.txt &&     python -m pip install -Ive ." did not complete successfully: exit code: 1

My system configuration is:

  • Ubuntu 22.04
  • CUDA 11.7
  • Docker 24.0.7

Is there any mismatch of torch and hawp, or my OS configuration.

AustrianOakvn avatar Nov 08 '23 09:11 AustrianOakvn