Repository: pytorch/benchmark
Issue: unable to proceed with the installation of detectron2_fasterrcnn_r_101_c4.
Root cause: External Dependency Breakage

I am using the torchbench.dockerfile environment in pytorch/benchmark/docker as my operating environment.

An error occurred during the setup of models/detectron2_fasterrcnn_r_101_c4.
I have checked and installed GCC and ninja related errors, but the installation still does not proceed.

I am in desperate need of your help.

The following is the output message:

running setup for /workspace/benchmark/torchbenchmark/models/demucs...OK
running setup for /workspace/benchmark/torchbenchmark/models/densenet121...OK
running setup for /workspace/benchmark/torchbenchmark/models/detectron2_fasterrcnn_r_101_c4...FAIL
Error for /workspace/benchmark/torchbenchmark/models/detectron2_fasterrcnn_r_101_c4:
---------------------------------------------------------------------------
  WARNING: Did not find branch or tag 'c470ca3', assuming revision or ref.
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [397 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/tools
      copying tools/train_net.py -> build/lib.linux-x86_64-cpython-310/tools
      copying tools/lightning_train_net.py -> build/lib.linux-x86_64-cpython-310/tools
      copying tools/lazyconfig_train_net.py -> build/lib.linux-x86_64-cpython-310/tools
      copying tools/benchmark.py -> build/lib.linux-x86_64-cpython-310/tools
      copying tools/__init__.py -> build/lib.linux-x86_64-cpython-310/tools
      copying tools/plain_train_net.py -> build/lib.linux-x86_64-cpython-310/tools
      copying tools/visualize_data.py -> build/lib.linux-x86_64-cpython-310/tools
      copying tools/analyze_model.py -> build/lib.linux-x86_64-cpython-310/tools
...
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> detectron2

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Traceback (most recent call last):
  File "/workspace/benchmark/torchbenchmark/models/detectron2_fasterrcnn_r_101_c4/install.py", line 8, in <module>
    install_detectron2(MODEL_NAME, MODEL_DIR)
  File "/workspace/benchmark/torchbenchmark/util/framework/detectron2/__init__.py", line 61, in install_detectron2
    pip_install_requirements()
  File "/workspace/benchmark/torchbenchmark/util/framework/detectron2/__init__.py", line 43, in pip_install_requirements
    subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-q', '-r', requirements_file])
  File "/opt/conda/envs/torchbench/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/conda/envs/torchbench/bin/python', '-m', 'pip', 'install', '-q', '-r', '/workspace/benchmark/torchbenchmark/util/framework/detectron2/requirements.txt']' returned non-zero exit status 1.

---------------------------------------------------------------------------

Traceback (most recent call last):
  File "/workspace/benchmark/install.py", line 114, in <module>
    raise RuntimeError("Failed to complete setup")
RuntimeError: Failed to complete setup

The log printed by `install.py` is incomplete, can you try the command at https://github.com/pytorch/benchmark/issues/1529#issuecomment-1499302427 and find the actual root cause of this failure?

This issue is a duplicate of #1529 . It has been resolved by referring to the solution provided in #1529 .