[Enhance] Make scipy as a default dependency in runtime in dev-1.x

This commit is contained in:
MengzhangLI 2022-11-30 21:51:38 +08:00
parent e98231ba5f
commit 925110044c
2 changed files with 10 additions and 4 deletions

View File

@ -140,6 +140,9 @@ def test_beit_init():
}
}
model = BEiT(img_size=(512, 512))
# If scipy is installed, this AttributeError would not be raised.
from mmengine.utils import is_installed
if not is_installed('scipy'):
with pytest.raises(AttributeError):
model.resize_rel_pos_embed(ckpt)

View File

@ -138,6 +138,9 @@ def test_mae_init():
}
}
model = MAE(img_size=(512, 512))
# If scipy is installed, this AttributeError would not be raised.
from mmengine.utils import is_installed
if not is_installed('scipy'):
with pytest.raises(AttributeError):
model.resize_rel_pos_embed(ckpt)