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

Works around internal PyTorch bug related to shared weights #96

Merged
merged 1 commit into from
Aug 2, 2018

Conversation

daniel-j-h
Copy link
Collaborator

The PyTorch tracing model exporter has an issue with shared weights / refs to layers, see

pytorch/pytorch#8392

The workaround is to not store any refs to the resnet layers in the model itself. Instead we have to directly pull the input tensors through the resnet layers in the forward pass.

This will change the .pth file format. We could work around that by loading the serialized state dict in non-strict fashion in the export tool. But then we are opening up the door to letting actual errors going through.

Note: we need to fix the FPN pull request in a similar way #75

cc @bkowshik @maning

@daniel-j-h
Copy link
Collaborator Author

This needs a release with major version bump since we are breaking the .pth format.

@daniel-j-h daniel-j-h merged commit ca3bc00 into master Aug 2, 2018
@daniel-j-h daniel-j-h deleted the shared-weights branch August 2, 2018 14: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.

1 participant