Skip to content

Commit

Permalink
[Fix] Fix lint and mmcv version requirement for IPU.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 committed Apr 29, 2022
1 parent b4eefe4 commit 1d6fbe0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
'.pos_embed': dict(decay_mult=0.0)
})

pretrained = 'https://download.openmmlab.com/mmclassification/v0/vit/pretrain/vit-base-p16_3rdparty_pt-64xb64_in1k-224_20210928-02284250.pth' # noqa

model = dict(
head=dict(
loss=dict(type='CrossEntropyLoss', loss_weight=1.0, _delete_=True), ),
backbone=dict(
img_size=224,
init_cfg=dict(
type='Pretrained',
checkpoint='https://download.openmmlab.com/mmclassification/v0/vit/pretrain/vit-base-p16_3rdparty_pt-64xb64_in1k-224_20210928-02284250.pth', # noqa
checkpoint=pretrained,
_delete_=True,
prefix='backbone')))

Expand Down
8 changes: 6 additions & 2 deletions mmcls/datasets/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
import torch
from mmcv.parallel import collate
from mmcv.runner import get_dist_info
from mmcv.utils import (IS_IPU_AVAILABLE, Registry, build_from_cfg,
digit_version)
from mmcv.utils import Registry, build_from_cfg, digit_version
from torch.utils.data import DataLoader

try:
from mmcv.utils import IS_IPU_AVAILABLE
except ImportError:
IS_IPU_AVAILABLE = False

if platform.system() != 'Windows':
# https://github.com/pytorch/pytorch/issues/973
import resource
Expand Down

0 comments on commit 1d6fbe0

Please sign in to comment.