Skip to content

Fix _LazyBatchNorm import broken by torch 1.10.0 #23

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 4 commits into from
Nov 10, 2021

Conversation

calvinmccarter-at-lightmatter
Copy link
Contributor

@calvinmccarter-at-lightmatter calvinmccarter-at-lightmatter commented Oct 27, 2021

Fixes #22 .

This PR is necessitated by this PyTorch PR which is now part of 1.10.0 pytorch/pytorch#60982

Unfortunately, this PR will break onnx2pytorch for torch<1.10.0, so it is not ready to be merged until I fix this.
Edit: this PR now works with torch < 1.10.0 and torch >= 1.10.0.

@ControllableGeneration
Copy link

I installed torch 1.10.0 but the problem was not resolved. Editing onnx2pytorch/operations/batchnorm.py and change _LazyBatchNorm to _LazyNormBase fixes the problem!b the issue

@calvinmccarter-at-lightmatter
Copy link
Contributor Author

@Talmaj - this PR is now ready for review.

Also resolves #25 (same as #23 ).

@Talmaj
Copy link
Owner

Talmaj commented Nov 9, 2021

@calvinmccarter-at-lightmatter can you add to tox.ini a new test env for torch<=1.9.0 ?

[tox]
envlist = clean,py36,py37,py38,py38-torch19,py39

[testenv]
passenv =
    CIRCLE*
    KMP_DUPLICATE_LIB_OK
deps =
    -rrequirements.txt
    torch19: torch <= 1.9.0.
    pytest-cov
commands =
    pytest --cov --cov-append --cov-report term --cov-report html tests/

@calvinmccarter-at-lightmatter
Copy link
Contributor Author

@Talmaj - done! and PR #27 is ready for review as well

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.

Error import _LazyBatchNorm
3 participants