directory

 

1. Install CUDA10.1. With reference to:

Install Pytorch

3. Install PyCocoTools

4. Install MMCV

5. Install MMDetection


1. Install CUDA10.1. With reference to:

Blog.csdn.net/hhhhhhhhhhw…

Install Pytorch

Conda install PyTorch TorchVision CudatoolKit =10.1 -C PyTorchCopy the code

Or:

PIP install torch = = 1.5.0 + cu101 torchvision = = 0.6.0 + cu101 -f https://download.pytorch.org/whl/torch_stable.htmlCopy the code

3,Install pycocotools

PIP install git+github.com/philferrier…

4. Install MMCV

pip install mmcv

5. Install MMDetection

Official website: github.com/open-mmlab/…

Git clone github.com/open-mmlab/…

cd mmdetection

pip install -r requirements.txt

Modify the compiled file:

. Change info = info.decode().lower() in ~Lib\site-packages\torch\utils\cpp_extension.py to info=info.decode(“utf8″,”ignore”).lower()

Change all decode() to decode(“utf8″,”ignore”)

Modify the setup.py file of mmDetection-master.

Will:

def make_cuda_ext(name, module, sources, sources_cuda=[]):

 

    define_macros = []

    extra_compile_args = {‘cxx’: []}

 

    if torch.cuda.is_available() or os.getenv(‘FORCE_CUDA’, ‘0’) == ‘1’:

        define_macros += [(‘WITH_CUDA’, None)]

        extension = CUDAExtension

        extra_compile_args[‘nvcc’] = [

            ‘-D__CUDA_NO_HALF_OPERATORS__’,

            ‘-D__CUDA_NO_HALF_CONVERSIONS__’,

            ‘-D__CUDA_NO_HALF2_OPERATORS__’,

        ]

        sources += sources_cuda

    else:

        print(f’Compiling {name} without CUDA’)

        extension = CppExtension

# raise EnvironmentError(‘CUDA is required to compile MMDetection! ‘)

 

    return extension(

        name=f'{module}.{name}’,

        sources=[os.path.join(*module.split(‘.’), p) for p in sources],

        define_macros=define_macros,

        extra_compile_args=extra_compile_args)

Is amended as:

def make_cuda_ext(name, module, sources, sources_cuda=[]):

    return CUDAExtension(

name='{}.{}’.format(module, name),

sources=[os.path.join(*module.split(‘.’), p) for p in sources],

extra_compile_args={

‘cxx’: [“-DMS_WIN64″,”-MD”],

‘nvcc’: [

‘-D__CUDA_NO_HALF_OPERATORS__’,

‘-D__CUDA_NO_HALF_CONVERSIONS__’,

‘-D__CUDA_NO_HALF2_OPERATORS__’,

]

})

Then run:

Python setup.py build_ext –inplace to compile

Python setup.py install develop Completes the installation

After execution, run PIP list to see:

Add: even after the installation is successful, it cannot be used! Windows is no longer supported in the new version! Oh, shit, that’s what people do