Skip to content

Commit

Permalink
fastai: Remove ProgressCallback in tests. (#347)
Browse files Browse the repository at this point in the history
* fastai: Remove ProgressCallback in tests.

Per fastai/fastai#3809

* pin PytTorch version.

Per pytorch/pytorch#85427
  • Loading branch information
daavoo committed Oct 31, 2022
1 parent da4f46c commit 256bbd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Expand Up @@ -66,6 +66,7 @@ fastai =
fastai
pytorch_lightning =
pytorch_lightning>=1.7
torch<1.13
all =
%(image)s
%(mmcv)s
Expand Down
3 changes: 3 additions & 0 deletions tests/test_fastai.py
Expand Up @@ -4,6 +4,7 @@
from fastai.tabular.all import (
Categorify,
Normalize,
ProgressCallback,
TabularDataLoaders,
accuracy,
tabular_learner,
Expand Down Expand Up @@ -39,6 +40,7 @@ def data_loader():

def test_fastai_callback(tmp_dir, data_loader):
learn = tabular_learner(data_loader, metrics=accuracy)
learn.remove_cb(ProgressCallback)
learn.model_dir = os.path.abspath("./")
learn.fit_one_cycle(2, cbs=[DvcLiveCallback("model")])

Expand All @@ -54,6 +56,7 @@ def test_fastai_callback(tmp_dir, data_loader):

def test_fastai_model_file(tmp_dir, data_loader):
learn = tabular_learner(data_loader, metrics=accuracy)
learn.remove_cb(ProgressCallback)
learn.model_dir = os.path.abspath("./")
learn.fit_one_cycle(2, cbs=[DvcLiveCallback("model")])
assert (tmp_dir / "model.pth").is_file()
Expand Down

0 comments on commit 256bbd2

Please sign in to comment.