Skip to content

Fix giou naming bug #5270

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

Merged
merged 12 commits into from
Jan 24, 2022
Merged

Fix giou naming bug #5270

merged 12 commits into from
Jan 24, 2022

Conversation

jdsgomes
Copy link
Contributor

This PR should fix the existing bug caused by the method name being the same as the module name.

before

import torch
from torchvision.ops import generalized_box_iou_loss
generalized_box_iou_loss(torch.zeros((0,4)), torch.zeros((0,4)), reduction="sum")
Traceback (most recent call last):
  File "./IPython/core/interactiveshell.py", line 3457, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-23-efc1ac3887dc>", line 1, in <module>
    generalized_box_iou_loss(torch.zeros((0,4)), torch.zeros((0,4)), reduction="sum")
TypeError: 'module' object is not callable

After PR

import torch
from torchvision.ops import generalized_box_iou_loss
generalized_box_iou_loss(torch.zeros((0,4)), torch.zeros((0,4)), reduction="sum")
tensor(0.)

cc @datumbox

@facebook-github-bot
Copy link

facebook-github-bot commented Jan 24, 2022

💊 CI failures summary and remediations

As of commit 5c3668f (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jdsgomes jdsgomes merged commit abdae5a into pytorch:main Jan 24, 2022
@oke-aditya
Copy link
Contributor

oke-aditya commented Jan 24, 2022

Sorry but, I guess this isn't a bug. It's an unreleased feature, so probably label as other?

@datumbox datumbox added enhancement and removed bug labels Jan 24, 2022
facebook-github-bot pushed a commit that referenced this pull request Feb 3, 2022
Summary:
* Adding multiweight support for shufflenetv2 prototype models

* Revert "Adding multiweight support for shufflenetv2 prototype models"

This reverts commit 31fadbe.

* Adding multiweight support for shufflenetv2 prototype models

* Revert "Adding multiweight support for shufflenetv2 prototype models"

This reverts commit 4e3d900.

* Remove module vs method name clash

Reviewed By: kazhang

Differential Revision: D33927499

fbshipit-source-id: 7e0d805150b8774d782b0cee8dbc15119cd1d2d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants