Closed Bin-ze closed 3 years ago
This error occurs for me when I run forward inferences on either of the CenterNet models. It's not a problem when running the CenterNet2 models. The fix is simple, and it's suggested in the error message. Replace view(N, -1) with reshape(N, -1).
#pre_nms_top_n = candidate_inds.view(N, -1).sum(1) # N
pre_nms_top_n = candidate_inds.reshape(N, -1).sum(1) # N
Thank you, not only because you have answered my questions for me, but more importantly, I am a novice in the field of target detection. As a newcomer to this field, I may need to ask a lot of questions. Undoubtedly, this will be a good start.
pre_nms_top_n = candidate_inds.contiguous().view(N, -1).sum(1) # N RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead. I change model as (ccandidate_inds.contiguous().view(N, -1).sum(1) # N),but stall have wrong ,can you help me ?