Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example not working #6787

Closed
Shorlaks opened this issue Dec 14, 2021 · 3 comments · Fixed by #7310
Closed

Example not working #6787

Shorlaks opened this issue Dec 14, 2021 · 3 comments · Fixed by #7310
Assignees

Comments

@Shorlaks
Copy link

Hi
Describe the bug
I'm running the example from the 'colab tutorial' and this is the result I get.

from mmdet.apis import inference_detector, init_detector, show_result_pyplot

# Specify the path to model config and checkpoint file
config_file = r'/home/mb2/Dan/mmdetection/configs/mask_rcnn/mask_rcnn_r50_fpn_mstrain-poly_3x_coco.py'
checkpoint_file = r'/home/mb2/Dan/mmdetection/checkpoints/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth'

# build the model from a config file and a checkpoint file
model = init_detector(config_file, checkpoint_file, device='cuda:0')

img = r'/home/mb2/Dan/mmdetection/demo/demo.jpg'
result = inference_detector(model, img)
show_result_pyplot(model, img, result, score_thr=0.3)

No bounding box's

Screenshot at 2021-12-14 11-01-55

@ZwwWayne
Copy link
Collaborator

Does this script have any log printed out?

@Shorlaks
Copy link
Author

That's the only thing in printed:

load checkpoint from local path: /home/mb2/Dan/mmdetection_old/checkpoints/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth
/home/mb2/Dan/mmdetection_old/mmdet/datasets/utils.py:69: UserWarning: "ImageToTensor" pipeline is replaced by "DefaultFormatBundle" for batch inference. It is recommended to manually replace it in the test data pipeline in your config file.
  'data pipeline in your config file.', UserWarning)

@fine2copyV
Copy link

I have the same problem ,but in windows sys
When I run this: result = inference_detector(model,img)
then,get errors:
C:\Anaconda\envs\mmdet\lib\site-packages\mmdet\datasets\utils.py:69: UserWarning: "ImageToTensor" pipeline is replaced by "DefaultFormatBundle" for batch inference. It is recommended to manually replace it in the test data pipeline in your config file.
'data pipeline in your config file.', UserWarning)
C:\Anaconda\envs\mmdet\lib\site-packages\torch\nn\functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at ..\c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants