Problem exporting model

I’m working on the flowers dataset and have trained my using fp16. When I try to export my model, I’m getting the following pickling error:

Could someone help me out as to why this is happening?

Can you show how you’re building your model? Optimizer, everything? Most likely you have a function declared as one of those parameters and it can’t pickle it

Yup. Building it as follows:

i also had error on learn.export() (although different one) but updating fastai helped

How are you making the DataLoader too?

As so:

Ah those lambda functions are the culprit. Don’t use lambda make explicit def myFunc() functions. Lambda won’t pickle

Try that and tell us if it helped :slight_smile:

1 Like

Is that so? Interesting! Will do and let you know!

Would a list comprehension suffice :-

get_y = [ x for x in labels_dict.getitem]