尊敬的作者您好,非常感谢您的科研贡献,我在复现您的代码的时候遇到了输入图像读取报错。
我已经正常安装模型、搭建环境、并将数据集放入指定位置;
具体报错如下:
python tools/test_det.py > configs/oscar/sota/oscar_w_noco_head_r18_caffe_fpn_p2_gn-head_1x_sirst_det2noco.py \
work_dirs/oscar_w_noco_head_r18_caffe_fpn_p2_gn-head_1x_sirst_det2noco.pth --eval "mNoCoAP"
/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmdet/utils/setup_env.py:38: UserWarning: Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
warnings.warn(
/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmdet/utils/setup_env.py:48: UserWarning: Setting MKL_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
warnings.warn(
libpng warning: iCCP: known incorrect sRGB profile
load checkpoint from local path: work_dirs/oscar_w_noco_head_r18_caffe_fpn_p2_gn-head_1x_sirst_det2noco.pth
[ ] 0/256, elapsed: 0s, ETA:/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/torch/nn/functional.py:3631: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
warnings.warn(
/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1634272068694/work/aten/src/ATen/native/TensorShape.cpp:2157.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/torch/nn/functional.py:3631: UserWarning: Default upsampling behavior when mode=nearest-exact is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
warnings.warn(
Traceback (most recent call last):
File "tools/test_det.py", line 274, in
main()
File "tools/test_det.py", line 240, in main
outputs = single_gpu_test(model, data_loader, args.show, args.show_dir,
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmdet/apis/test.py", line 29, in single_gpu_test
result = model(return_loss=False, rescale=True, **data)
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py", line 51, in forward
return super().forward(*inputs, **kwargs)
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 116, in new_func
return old_func(*args, **kwargs)
File "/home/sunxue/open-deepinfrared-master/deepir/models/detectors/oscar.py", line 66, in forward
return self.forward_test(img, img_metas, **kwargs)
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmdet/models/detectors/base.py", line 147, in forward_test
return self.simple_test(imgs[0], img_metas[0], **kwargs)
File "/home/sunxue/open-deepinfrared-master/deepir/models/detectors/oscar.py", line 132, in simple_test
results_list = self.bbox_head.simple_test(
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmdet/models/dense_heads/base_dense_head.py", line 360, in simple_test
return self.simple_test_bboxes(feats, img_metas, rescale=rescale)
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmdet/models/dense_heads/dense_test_mixins.py", line 37, in simple_test_bboxes
results_list = self.get_bboxes(
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 205, in new_func
return old_func(*args, **kwargs)
File "/home/sunxue/open-deepinfrared-master/deepir/models/dense_heads/oscar/oscar_w_noco_head.py", line 985, in get_bboxes
anchors = [F.interpolate(decoded_coarse_bbox_preds,
File "/home/sunxue/anaconda3/envs/py3.8_new/lib/python3.8/site-packages/torch/nn/functional.py", line 3752, in interpolate
raise NotImplementedError(
NotImplementedError: Input Error: Only 3D, 4D and 5D input Tensors supported (got 4D) for the modes: nearest | linear | bilinear | bicubic | trilinear (got nearest-exact)