Can't pickle local object - exporting model

You have a function in a function, pickle doesn’t like that.

Separate out get_y outside your get_dls function and it’ll work fine.

Also make sure that your get_y function is available when calling load_learner, as it needs the reference to load in the pickle file

1 Like