Can not install maskrcnn-benchmark

username: Shantanu_Ghosh
cooked: <p>Hello,</p>
<p>I tried to install maskrcnn-benchmark using</p><aside class="onebox githubblob" data-onebox-src="https://github.com/facebookresearch/maskrcnn-benchmark/blob/main/INSTALL.md">
  <header class="source">

      <a href="https://github.com/facebookresearch/maskrcnn-benchmark/blob/main/INSTALL.md" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/facebookresearch/maskrcnn-benchmark/blob/main/INSTALL.md" target="_blank" rel="noopener nofollow ugc">facebookresearch/maskrcnn-benchmark/blob/main/INSTALL.md</a></h4>


      <pre><code class="lang-md">## Installation

### Requirements:
- PyTorch 1.0 from a nightly release. It **will not** work with 1.0 nor 1.0.1. Installation instructions can be found in https://pytorch.org/get-started/locally/
- torchvision from master
- cocoapi
- yacs
- matplotlib
- GCC &gt;= 4.9
- OpenCV
- CUDA &gt;= 9.0


### Option 1: Step-by-step installation

```bash
# first, make sure that your conda is setup properly with the right environment
# for that, check that `which conda`, `which pip` and `which python` points to the
# right path. From a clean conda env, this is what you need to do

</code></pre>



  This file has been truncated. <a href="https://github.com/facebookresearch/maskrcnn-benchmark/blob/main/INSTALL.md" target="_blank" rel="noopener nofollow ugc">show original</a>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>However, when I tried to install<br>
conda install -c pytorch pytorch-nightly torchvision cudatoolkit=9.0, i got package not found error for pytorch-nightly.</p>
<p>So i tried using the following installation command:<br>
conda install -c pytorch -c pytorch-nightly torchvision cudatoolkit=9.0</p>
<p>Then I tried to install apex, using<br>
cd $INSTALL_DIR<br>
git clone <a href="https://github.com/NVIDIA/apex.git" class="inline-onebox" rel="noopener nofollow ugc">GitHub - NVIDIA/apex: A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch</a><br>
cd apex<br>
python setup.py install --cuda_ext --cpp_ext</p>
<p>Here i get the following error:<br>
No CUDA runtime is found, using CUDA_HOME=‘/jet/packages/spack/opt/spack/linux-centos8-zen/gcc-8.3.1/cuda-10.1.243-6jj3rycvluxj2monv2nr43ay7ttuci4c’</p>
<p>Warning: Torch did not find available GPUs on this system.<br>
If your intention is to cross-compile, this is not an error.<br>
By default, Apex will cross-compile for Pascal (compute capabilities 6.0, 6.1, 6.2),<br>
Volta (compute capability 7.0), Turing (compute capability 7.5),<br>
and, if the CUDA version is &gt;= 11.0, Ampere (compute capability 8.0).<br>
If you wish to cross-compile for a single specific architecture,<br>
export TORCH_CUDA_ARCH_LIST=“compute capability” before running setup.py.</p>
<p>torch.<strong>version</strong>  = 1.13.0</p>
<p>Traceback (most recent call last):<br>
File “setup.py”, line 178, in <br>
check_cuda_torch_binary_vs_bare_metal(CUDA_HOME)<br>
File “setup.py”, line 27, in check_cuda_torch_binary_vs_bare_metal<br>
torch_binary_version = parse(torch.version.cuda)<br>
File “/ocean/projects/asc170022p/shg121/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/packaging/version.py”, line 52, in parse<br>
return Version(version)<br>
File “/ocean/projects/asc170022p/shg121/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/packaging/version.py”, line 195, in <strong>init</strong><br>
match = self._regex.search(version)<br>
TypeError: expected string or bytes-like object</p>
<p>I tried installing cuda using following commands:<br>
conda install pytorch==1.0.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch-nightly<br>
conda install pytorch==1.0.0 torchvision==0.2.1 cuda90 -c pytorch<br>
conda install pytorch==1.0.1 torchvision==0.2.2 cudatoolkit=9.0 -c pytorch<br>
And got other errors. So can someone help with the correct versions of pytorch, torchvision, cuda for maskrcnn-benchmark installation?</p>
<p>PS: I am trying to run the following repo:</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://github.com/Twizwei/bddoia_project">
  <header class="source">
      <img src="https://github.githubassets.com/favicons/favicon.svg" class="site-icon" width="32" height="32">

      <a href="https://github.com/Twizwei/bddoia_project" target="_blank" rel="noopener nofollow ugc">GitHub</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:690/345;"><img src="https://opengraph.githubassets.com/bd2192cc5d61837d9b66e4bce3dcc382a844cbadc5899a43146ceca71db5012d/Twizwei/bddoia_project" class="thumbnail" width="690" height="345"></div>

<h3><a href="https://github.com/Twizwei/bddoia_project" target="_blank" rel="noopener nofollow ugc">GitHub - Twizwei/bddoia_project</a></h3>

  <p>Contribute to Twizwei/bddoia_project development by creating an account on GitHub.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>


username: ptrblck
cooked: <p>The error seems to be raised by <code>packaging.version.parse</code> as a PyTorch installation with a CUDA runtime is expected, while it seems you are using the CPU-only binary.<br>
Make sure PyTorch with GPU support is installed and then try to build <code>apex</code> (it wouldn’t make sense to build it for a CPU-only workload).</p>

username: Shantanu_Ghosh
cooked: <p>I am running it on the server before running the final command to build apex. And prior running to this i ran a job to set up the cuda environment,  but still getting the error:<br>
Compiling cuda extensions with<br>
nvcc: NVIDIA (R) Cuda compiler driver<br>
Copyright (c) 2005-2019 NVIDIA Corporation<br>
Built on Sun_Jul_28_19:07:16_PDT_2019<br>
Cuda compilation tools, release 10.1, V10.1.243<br>
from /jet/packages/spack/opt/spack/linux-centos8-zen/gcc-8.3.1/cuda-10.1.243-6jj3rycvluxj2monv2nr43ay7ttuci4c/bin</p>
<p>Traceback (most recent call last):<br>
File “setup.py”, line 178, in <br>
check_cuda_torch_binary_vs_bare_metal(CUDA_HOME)<br>
File “setup.py”, line 37, in check_cuda_torch_binary_vs_bare_metal<br>
+ "In some cases, a minor-version mismatch will not cause later errors:  "<br>
RuntimeError: Cuda extensions are being compiled with a version of Cuda that does not match the version used to compile Pytorch binaries.  Pytorch binaries were compiled with Cuda 10.2.<br>
In some cases, a minor-version mismatch will not cause later errors:  <a href="https://github.com/NVIDIA/apex/pull/323#discussion_r287021798" class="inline-onebox" rel="noopener nofollow ugc">Hard error on mismatch between torch.version.cuda and + the Cuda toolkit version being used to compile Apex by mcarilli · Pull Request #323 · NVIDIA/apex · GitHub</a>.  You can try commenting out this check (at your own risk).</p>
<p>and I installed cuda using this:<br>
conda install pytorch==1.7.1 torchvision==0.8.2  cudatoolkit=9.0 -c pytorch-nightly</p>

username: ptrblck
cooked: <p>Refer to the error message to remove the minor version CUDA check at your own risk or install the matching CUDA toolkit version as used in the PyTorch binaries you are using.</p>