millions-hydrogen-58905
05/01/2024, 3:48 PMpants test :: , but it is failing. The failure it shows is this
ProcessExecutionFailure: Process 'Building requirements.pex with 2 requirements: detectron2@ git+<https://github.com/facebookresearch/detectron2.git>, torch' failed with exit code 1
And
ModuleNotFoundError: No module named 'torch'
The requirements file is this
--extra-index-url <https://download.pytorch.org/whl/cu118>
torch
detectron2 @ git+<https://github.com/facebookresearch/detectron2.git>lemon-eye-70471
05/01/2024, 3:55 PMtorch explicitly as a dependency in the python_test or python_tests target?millions-hydrogen-58905
05/01/2024, 4:06 PMwide-midnight-78598
05/01/2024, 5:50 PMpytorch == torch? Or is torch the pip install command as well?millions-hydrogen-58905
05/01/2024, 6:17 PMwide-midnight-78598
05/01/2024, 6:57 PMpip install outside of pants - complains about torch. Is this supposed to be installed with an older pip or something?wide-midnight-78598
05/01/2024, 7:07 PMsetuptools wheel cython numpy torch and then maybe had to use --no-build-isolation
Edit: Subset may have been: install setuptools wheel torch and then install detectroncareful-address-89803
05/05/2024, 5:04 PM[python-repos].indexes config setting (doc on using custom repositories)wide-midnight-78598
05/05/2024, 10:29 PMcareful-address-89803
05/06/2024, 4:34 AMtorch to be installed when it's building the wheels (import torch in setup.py)
• the proposed answer the last time this came up, to use a fork to patch it to specify that it needs torch during setup, makes sense (not much change if you're already using git as a source)
• You could also pre-build the wheels yourself targeting matching versions of torch and cuda. A complication is building these for all torch and cuda you'll use, but there might not be that many. You could then:
◦ host them in a way [python-repos].find_links can find them, which could just be some files in a storage bucket (it looks like detectron used to do this, but not for their more recent versions)
◦ build them and push to a python package registry and use [python-repos].indexes (if you've already got an internal one, this might be pretty easy)