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

inference error #16

Open
dagezhuang opened this issue Jun 28, 2022 · 0 comments
Open

inference error #16

dagezhuang opened this issue Jun 28, 2022 · 0 comments

Comments

@dagezhuang
Copy link

The faster_rcnn_r50_sspnet_1x_coco can be trained correctly, but when I inference the trained model then encountered the error below.

inference_detector(model, imagepath)

python inference_img.py
/home/ubuntu/mmdetection-2.19.0/mmdet/models/builder.py:53: UserWarning: train_cfg and test_cfg is deprecated, please specify them in model
'please specify them in model', UserWarning)
load checkpoint from local path: /home/ubuntu/fovea/sspnet/epoch_1.pth
/home/ubuntu/mmdetection-2.19.0/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)
/home/ubuntu/anaconda3/envs/openmmlab2/lib/python3.7/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 /pytorch/c10/core/TensorImpl.h:1156.)
return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
Traceback (most recent call last):
File "inference_img.py", line 26, in
result = inference_detector(model, imagepath)
File "/home/ubuntu/mmdetection-2.19.0/mmdet/apis/inference.py", line 147, in inference_detector
results = model(return_loss=False, rescale=True, **data)
File "/home/ubuntu/anaconda3/envs/openmmlab2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ubuntu/anaconda3/envs/openmmlab2/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 109, in new_func
return old_func(*args, **kwargs)
File "/home/ubuntu/mmdetection-2.19.0/mmdet/models/detectors/base.py", line 174, in forward
return self.forward_test(img, img_metas, **kwargs)
File "/home/ubuntu/mmdetection-2.19.0/mmdet/models/detectors/base.py", line 147, in forward_test
return self.simple_test(imgs[0], img_metas[0], **kwargs)
File "/home/ubuntu/mmdetection-2.19.0/mmdet/models/detectors/faster_rcnn_ssp.py", line 186, in simple_test
x = self.extract_feat(img)
File "/home/ubuntu/mmdetection-2.19.0/mmdet/models/detectors/faster_rcnn_ssp.py", line 70, in extract_feat
x, att = self.neck(x)
ValueError: too many values to unpack (expected 2)

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

No branches or pull requests

1 participant