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

Running retinanet demo example #34

Open
ghada-soliman opened this issue Jan 3, 2021 · 4 comments
Open

Running retinanet demo example #34

ghada-soliman opened this issue Jan 3, 2021 · 4 comments

Comments

@ghada-soliman
Copy link

Hello,

I have the following issue when running any of the demo example on retinanet.
May you please advise in this

self.anchor_idxs tensor([], dtype=torch.int64) tensor([], dtype=torch.int64)
Traceback (most recent call last):
File "detection/demo_retinanet.py", line 185, in
main(arguments)
File "detection/demo_retinanet.py", line 147, in main
mask, box, class_id = grad_cam(inputs) # cam mask
File "/content/Grad-CAM.pytorch/detection/grad_cam_retinanet.py", line 61, in call
output = self.net.predict([inputs])
File "/content/detectron2_repo/detectron2/modeling/meta_arch/retinanet.py", line 531, in predict
results = self.inference(box_cls, box_delta, anchors, images.image_sizes)
File "/content/detectron2_repo/detectron2/modeling/meta_arch/retinanet.py", line 422, in inference
anchors, pred_logits_per_image, deltas_per_image, image_size
File "/content/detectron2_repo/detectron2/modeling/meta_arch/retinanet.py", line 477, in inference_single_image
predicted_boxes = self.box2box_transform.apply_deltas(box_reg_i, anchors_i.tensor)
File "/content/detectron2_repo/detectron2/modeling/box_regression.py", line 101, in apply_deltas
pred_ctr_x = dx * widths[:, None] + ctr_x[:, None]
RuntimeError: The size of tensor a (25) must match the size of tensor b (0) at non-singleton dimension 1

Thanks.

@yizt
Copy link
Owner

yizt commented Jan 4, 2021

@ghada-soliman 麻烦发一下测试的图像

@ghada-soliman
Copy link
Author

I used the same test images within the folder of GitHub repository. An example is: "--input ./examples/pic1.jpg"

@yizt
Copy link
Owner

yizt commented Jan 6, 2021

I used the same test images within the folder of GitHub repository. An example is: "--input ./examples/pic1.jpg"

@ghada-soliman 估计不同版本的问题,可否发下您的python,pytorch,detectron2的版本,我测试一下

@ravising-h
Copy link

lower down the confidence. It worked for me.
Also remove predict function in grad-cam, instead of self.net.predict([inputs]) use self.net([inputs]). It will work. My detectron version is 2-0.3 and torch is 1.7.

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

3 participants