Fastai: Load_learner expects file to be called "export.pkl"

Created on 12 Jun 2019  路  3Comments  路  Source: fastai/fastai

Hi all it looks like the load learner expects the export file to be called "export.pkl"

# exporting learner
learn.export(Path(ROOT_PATH)/'fastai-retinanet.pkl')

# loading learner for inference
learn = load_learner(Path(ROOT_PATH)/'fastai-retinanet.pkl')

NotADirectoryError: [Errno 20] Not a directory: '/home/lab/data/fastai-retinanet.pkl/export.pkl'

Most helpful comment

Hi @attibalazs , you may try
learn = load_learner(Path(ROOT_PATH), 'fastai-retinanet.pkl')
fastai will look for export.pkl by default if you do not specify file name as the 2nd parameter.

All 3 comments

Hi @attibalazs , you may try
learn = load_learner(Path(ROOT_PATH), 'fastai-retinanet.pkl')
fastai will look for export.pkl by default if you do not specify file name as the 2nd parameter.

yes that works thank you !

this doesn't work for fastai v2

Was this page helpful?
0 / 5 - 0 ratings