Can not install maskrcnn-benchmark


I tried to install maskrcnn-benchmark using

However, when I tried to install
conda install -c pytorch pytorch-nightly torchvision cudatoolkit=9.0, i got package not found error for pytorch-nightly.

So i tried using the following installation command:
conda install -c pytorch -c pytorch-nightly torchvision cudatoolkit=9.0

Then I tried to install apex, using
git clone GitHub - NVIDIA/apex: A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch
cd apex
python install --cuda_ext --cpp_ext

Here i get the following error:
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’

Warning: Torch did not find available GPUs on this system.
If your intention is to cross-compile, this is not an error.
By default, Apex will cross-compile for Pascal (compute capabilities 6.0, 6.1, 6.2),
Volta (compute capability 7.0), Turing (compute capability 7.5),
and, if the CUDA version is >= 11.0, Ampere (compute capability 8.0).
If you wish to cross-compile for a single specific architecture,
export TORCH_CUDA_ARCH_LIST=“compute capability” before running

torch.version = 1.13.0

Traceback (most recent call last):
File “”, line 178, in
File “”, line 27, in check_cuda_torch_binary_vs_bare_metal
torch_binary_version = parse(torch.version.cuda)
File “/ocean/projects/asc170022p/shg121/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/packaging/”, line 52, in parse
return Version(version)
File “/ocean/projects/asc170022p/shg121/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/packaging/”, line 195, in init
match =
TypeError: expected string or bytes-like object

I tried installing cuda using following commands:
conda install pytorch==1.0.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch-nightly
conda install pytorch==1.0.0 torchvision==0.2.1 cuda90 -c pytorch
conda install pytorch==1.0.1 torchvision==0.2.2 cudatoolkit=9.0 -c pytorch
And got other errors. So can someone help with the correct versions of pytorch, torchvision, cuda for maskrcnn-benchmark installation?

PS: I am trying to run the following repo:

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

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:
Compiling cuda extensions with
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
from /jet/packages/spack/opt/spack/linux-centos8-zen/gcc-8.3.1/cuda-10.1.243-6jj3rycvluxj2monv2nr43ay7ttuci4c/bin

Traceback (most recent call last):
File “”, line 178, in
File “”, line 37, in check_cuda_torch_binary_vs_bare_metal
+ "In some cases, a minor-version mismatch will not cause later errors: "
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.
In some cases, a minor-version mismatch will not cause later errors: 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. You can try commenting out this check (at your own risk).

and I installed cuda using this:
conda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=9.0 -c pytorch-nightly

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.