question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NMS_GPU different results from NMS_CPU

See original GitHub issue

I compiled successfully in Ubuntu 14.04 and I use Python 3.6

import numpy as np
detections = torch.from_numpy(np.array([
    (12, 84, 140, 212, 0.1),
	(24, 84, 152, 212, 0.8),
	(36, 84, 164, 212, 0.7),
	(12, 96, 140, 224, 0.6),
	(24, 96, 152, 224, 0.5),
	(24, 108, 152, 236, 0.9)
]))

# print(detections)
print(nms_gpu(detections, 0.1))
print(nms_cpu(detections, 0.1))

## print results below
tensor([], dtype=torch.int32)
tensor([ 5], dtype=torch.int32)

You can see here, the CPU results is correct, whereas the GPU results is not returning anything

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
zhenhenycommented, Jul 1, 2018

Hi @sidazhang @jwyang I think it is related to #212 . Line 23 and Line 24 need to be fixed. https://github.com/jwyang/faster-rcnn.pytorch/blob/7079dfbc4e734168e1a123cb1a5a60cdc39f52ed/lib/model/nms/nms_cpu.py#L23

xx2 = np.minimum(x2[i], x2[order[1:]])
yy2 = np.minimum(y2[i], y2[order[1:]])

should generate same results as gpu version code.

0reactions
devendraswamycommented, Dec 26, 2019

when i am kept the training, in few minutes the server was restarted so please tell any suggestion for this . thanking you !

Read more comments on GitHub >

github_iconTop Results From Across the Web

NMS CPU vs GPU · Issue #33 · smallcorgi/Faster-RCNN_TF
Hi, I am running into this problem that NMS gave different results in CPU or GPU. I am not sure if I am...
Read more >
Reflections on Non Maximum Suppression (NMS)
Soft NMS appears to help in detecting similar objects close to each (i.e. have high IOU) and can result in 1–3% higher mAP....
Read more >
Different results GPU vs CPU - no idea why - Google Groups
Everything works fine on my CPU, and the CPU of the remote computer (Ubuntu) I am SSH'ing into - I need to run...
Read more >
Different results when running on CPU or GPU - Julia Discourse
Different results when running on CPU or GPU ... We see then that floating point operations are managed slightly differently on the cpu...
Read more >
where can I find this non-max suppression file called in the ...
NMS iteratively removes lower scoring boxes which have an IoU greater than iou_threshold with another (higher scoring) box.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found