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

Fix deeplab #1508

Closed
wants to merge 5 commits into from
Closed

Fix deeplab #1508

wants to merge 5 commits into from

Conversation

fmassa
Copy link
Member

@fmassa fmassa commented Oct 21, 2019

Alternative implementation to #1436

@eellison let me know if you think this could work. I've tried it locally and it seems to be ok.

@fmassa fmassa requested a review from eellison October 21, 2019 13:34

def forward(self, x):
size = x.shape[-2:]
x = super(ASPPPooling, self).forward(x)
# workaround while torchscript doesn't support overriding forward in nn.Sequential
x = getattr(self, '0')(x)
Copy link
Contributor

Choose a reason for hiding this comment

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

does self.0 not work here instead ? TorchScript doesn't support getattr

Copy link
Member Author

Choose a reason for hiding this comment

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

self.0 is an invalid syntax in python unfortunately.

This is weird, because I tried compiling this code and running it, and it seemed to work fine and give the same result as the non-compiled version

Copy link

Choose a reason for hiding this comment

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

This looks pretty hacky :-)

@eellison
Copy link
Contributor

Let me take a look at supporting sequentials with custom forwards in Torchscript and report back.

@fmassa
Copy link
Member Author

fmassa commented Nov 15, 2019

Subsumed by #1575

@fmassa fmassa closed this Nov 15, 2019
@fmassa fmassa deleted the fix_deeplab branch November 15, 2019 19:28
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

Successfully merging this pull request may close these issues.

3 participants