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

Bump to pytorch 1.9 and torchvision 0.10.0 #914

Closed
wants to merge 3 commits into from
Closed

Bump to pytorch 1.9 and torchvision 0.10.0 #914

wants to merge 3 commits into from

Conversation

weiji14
Copy link

@weiji14 weiji14 commented Sep 2, 2021

Update dependency pins in setup.cfg to be:

  • torch >=1.7.0,<1.10
  • torchvision >=0.8.0,<0.11

Also update Github Actions CI to use mmcv-full=1.3.12 pytorch1.9-cpu version.

Fixes #739. Xref previous bump to pytorch 1.8 at #822.

@weiji14 weiji14 marked this pull request as ready for review September 3, 2021 03:56
@weiji14
Copy link
Author

weiji14 commented Sep 3, 2021

Need approval to run GitHub Actions CI tests 😄. Meanwhile, I've ran the tests locally using pytest --verbose tests -m "not cuda" and haven't got any failing tests. Report summary showed 287 passed, 34 skipped, 6 deselected, 1377 warnings (let me know too if I should run any tests on a GPU). Local dependencies used (from pip list) are:

  • python=3.8.10
  • torch=1.9.0+cpu
  • torchvision=0.10.0+cpu
  • torchmetrics=0.5.1
  • pytorch-lightning=1.4.5
  • mmcv-full=1.3.12
  • mmdet=2.12.0
  • fastai=2.3.1
  • fastcore=1.3.26
  • fastprogress=1.0.0

If you want, I can open up a separate PR to improve the GitHub Actions workflow in ci-all-testing.yml to test different Pytorch vesions (1.7, 1.8, 1.9). Not sure how many versions people would like icevision to support.

@lgvaz
Copy link
Collaborator

lgvaz commented Sep 8, 2021

Hi!! Sorry for the delay, I just approved the actions

If you want, I can open up a separate PR to improve the GitHub Actions workflow in ci-all-testing.yml to test different Pytorch vesions (1.7, 1.8, 1.9)

I think this would be nice! But I'm not sure it's so straight forward. The hard part is not being able to support multiple torch versions, but the matching version required for other dependencies like mmdet, fastai and lightning

@weiji14
Copy link
Author

weiji14 commented Sep 9, 2021

Hi!! Sorry for the delay, I just approved the actions

Cool, I see there are some test failures at https://github.com/airctic/icevision/pull/914/checks?check_run_id=3545089831#step:6:37. Looks like mmcv 1.3.6 introduced some backward incompatible changes:

ImportError while loading conftest '/home/runner/work/icevision/icevision/tests/conftest.py'.
tests/conftest.py:2: in <module>
    from icevision import *
icevision/__init__.py:7: in <module>
    from icevision import models
icevision/models/__init__.py:22: in <module>
    from icevision.models import mmdet
icevision/models/mmdet/__init__.py:1: in <module>
    from icevision.models.mmdet import common
icevision/models/mmdet/common/__init__.py:3: in <module>
    from icevision.models.mmdet.common import bbox
icevision/models/mmdet/common/bbox/__init__.py:1: in <module>
    from icevision.models.mmdet.common.bbox.dataloaders import *
icevision/models/mmdet/common/bbox/dataloaders.py:10: in <module>
    from icevision.models.mmdet.common.utils import convert_background_from_zero_to_last
icevision/models/mmdet/common/utils.py:11: in <module>
    from mmdet.models import build_detector
/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/mmdet/models/__init__.py:1: in <module>
    from .backbones import *  # noqa: F401,F403
/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/mmdet/models/backbones/__init__.py:2: in <module>
    from .detectors_resnet import DetectoRS_ResNet
/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/mmdet/models/backbones/detectors_resnet.py:10: in <module>
    from .resnet import BasicBlock
/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/mmdet/models/backbones/resnet.py:10: in <module>
    from ..utils import ResLayer
/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/mmdet/models/utils/__init__.py:6: in <module>
    from .transformer import (DetrTransformerDecoder, DetrTransformerDecoderLayer,
/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/mmdet/models/utils/transformer.py:8: in <module>
    from mmcv.cnn.bricks.transformer import (BaseTransformerLayer,
E   ImportError: cannot import name 'MultiScaleDeformableAttention' from 'mmcv.cnn.bricks.transformer' (/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/mmcv/cnn/bricks/transformer.py)

Do you want me to 1) fix this error directly in this PR so that mmcv>1.3.6 will work or 2) pin mmcv to 1.3.5 and fix the error in a separate PR?

If you want, I can open up a separate PR to improve the GitHub Actions workflow in ci-all-testing.yml to test different Pytorch vesions (1.7, 1.8, 1.9)

I think this would be nice! But I'm not sure it's so straight forward. The hard part is not being able to support multiple torch versions, but the matching version required for other dependencies like mmdet, fastai and lightning

There's a way to pair up dependencies on GitHub Actions, I've opened up a proof of concept PR at #915. Let's discuss this there 😄

@weiji14 weiji14 closed this Dec 18, 2021
@weiji14 weiji14 deleted the pytorch-1.9 branch December 18, 2021 17:31
@ai-fast-track
Copy link
Collaborator

Hey @weiji14, my sincere apologies for the lack of follow-up. We aren't very active on GitHub. Are you part our IceVision forum. If not, here is an invitation (feel free to ping me there @farid):

• IceVision Forum: discord.gg/JDBeZYK

We are trying to find an optimal way to easy the installation process.

@weiji14
Copy link
Author

weiji14 commented Dec 20, 2021

Hi @ai-fast-track, that's ok. I was just trying to do a quickfix while trying out icevision, but discovered that the package might not be suitable for my use case. I might revisit this next time for another computer vision project next time. Good luck!

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.

Update to torch 1.8
3 participants