简体   繁体   中英

Saving and a fast.ai v1 ULMFiT model. to/from disk

Simple Question.

I have been doing experiments with ULMFiT

Yet I do not see a way to save and load models to/from disk easily? There is a load method available to the RNNLearner class that is created in this example, but it is not documented.

I have tried several methods and none of them work. Is there something i am missing? There do not seem to be any examples of a fast ai v1 model loaded from disk.

The RNNLearner() class has a save_encoder() method. For example, if your RNNLearner() object is called learn , then the call invoke the save_encoder() method would be: learn.save_encoder(name='my_model_name')

Also, the RNNLearner() class inherits from the Learner() class , which itself contains a save() method.

Both the save_encoder() and save() methods have a name argument which takes a string that will serve as the name under which your model is saved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM