我用google的colab搭建。
# Check nvcc version
!nvcc -V
# Check GCC version
!gcc --version
# install dependencies: (use cu111 because colab has CUDA 11.1)
%pip install -U openmim
!mim install "mmengine>=0.7.0"
!mim install "mmcv>=2.0.0rc4"# Install mmdetection
!rm -rf mmdetection
!git clone https://github.com/open-mmlab/mmdetection.git
%cd mmdetection%pip install -e .
from mmengine.utils import get_git_hash
from mmengine.utils.dl_utils import collect_env as collect_base_envimport mmdetdef collect_env():"""Collect the information of the running environments."""env_info = collect_base_env()env_info['MMDetection'] = f'{mmdet.__version__}+{get_git_hash()[:7]}'return env_infoif __name__ == '__main__':for name, val in collect_env().items():print(f'{name}: {val}')
千万注意,gradio安装3.50.0版本,太高或太低都会出问题。
%pip install "gradio==3.50.0"
!python projects/gradio_demo/launch.py
浏览器访问一下,一切正常