Issue loading OR saving encoder for learner

I’m trying to implement the same workflow on the Yelp dataset that Jeremy implemented for IMDB. Everything came along fine until I needed to upload the encoder portion into my text classifier learner.

I am getting ": FileNotFoundError: [Errno 2] No such file or directory:’/home/jupyter/.fastai/data/yelp_review_polarity_csv/models/fine_tuned_enc.pth "

I saved the language model encoder in the same fashion as in the lecture. I also tried to export the function but to no avail. I am using GCP. Obviously my attempt to save the encoder did not lead to the trained weights being deposited in the appropriate location for me to just simply use learn.load_encoder.

I saved and attached a pdf (not sure if it’ll export correctly into forum)

Any and all guidance would be greatly appreciated. Thanks!!!

`yelp_polarity_extract.pdf (164.3 KB)

In case anyone comes across this issue in the future…
I had not declared the path variable when I created the language model dataset, so when I tried saving the trained weights/encoder the library saved it to a models folder in the local directory. By simply ensuring that the path is designated – there’s no issue when loading encoder for text classifier, because that will look in the path that’s specified for the pretrained model weights.