inference is not work
See original GitHub issuehere is my inference script `import mmcv import os import numpy as np from tqdm import tqdm import json import cv2
def show_result(result): bbox_result = result bboxes = np.vstack(bbox_result) labels = [ np.full(bbox.shape[0], i, dtype=np.int32) for i, bbox in enumerate(bbox_result) ] labels = np.concatenate(labels) return bboxes,labels
config_file = ‘/data/lzy_intern/mmdetection/configs/my_config/image_ann_cascade_rcnn_x101_64x4d_fpn_1x.py’ checkpoint_file = ‘/data/lzy_intern/mmdetection/models/cascade_rcnn_x101_64x4d_fpn_1x.pth’ model = init_detector(config_file, checkpoint_file, device = ‘cuda:2’)
image = mmcv.imread(‘/data/lzy_intern/dataset/coco/train2017/000000174601.jpg’) result = inference_detector(model,image) bbox,label = show_result(result) print(len(bbox)) print(len(label))`
the checkpoint model is download from https://s3.ap-northeast-2.amazonaws.com/open-mmlab/mmdetection/models/cascade_rcnn_x101_64x4d_fpn_1x_20181218-e2dc376a.pth and the config file is the deafult version of mmdetection, but why is output of len(bbox) and len(label) is 0, Is the inference is not work?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
You may try
device = 'cuda:0'
.I meet the same problem. It bothers me a lot. At last I find that it works only use device = ‘cuda:0’. The result will become abnormal when use other devices such as device = ‘cuda:1’ or as device = ‘cuda:2’ Could you explain it in detail? Thanks! @hellock