open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
7.7k stars 2.53k forks source link

How to use multiple gpu while using mmseg as dependent library for inference #3614

Open ming-gray opened 3 months ago

ming-gray commented 3 months ago

Can multiple GPUs be used when inferring images?

from mmseg.apis import init_model, inference_model ... model = init_model(config_path, checkpoint_path, device='cuda:0')

mmcv 2.1.0
mmdet 3.3.0
mmengine 0.10.3
mmsegmentation 1.2.2

djl00 commented 2 months ago

你好,如果有多个gpu,模型进行推理的时候默认的是使用1个gpu吗?在win系统上可以多Gpu训练或者推理吗