hi All,
I am new to Fastai and am using the binary segmentation notebook that is in the Zach Mueller’s lessons (thanks Zach for amazing work!!).
My model is as follows:
learn = unet_learner(dls, resnet34)
learn.model_dir=‘gdrive/My Drive/ML/Project1/models/’
learn.fit(10, max_lr=slice(1e-5, 1e-3))
learn.save(‘stage1’)
This saves the model in the models directory: gdrive/My Drive/ML/Project1/models/stage1.pth
Now, like FastAi v1, I wanted to export model to create a pkl file that I can load to create a new learner for Prediction.
learn.export()
PicklingError: Can’t pickle <function at 0x7fb30fd85598>: attribute lookup on main failed
My requirement is to crete a new notebook, when I load the exported model and create an inference server that will help me to load 1 single image that will be segmented.
In the class notes, the inference is created in the same notebook as training. Is there any other notebook where I can load the model and run inference?
How are you creating the DataBlock? Is there any lambda functions being used? If so replace them with full functions (def myFunc()) as lambda wont pickle
Hello and thank you for your post.
I’m new to Fastai too, and I want to do like you :
My requirement is to create a new notebook, when I load the exported model and create an inference server that will help me to load 1 single image that will be segmented.
In the class notes, the inference is created in the same notebook as training. Is there any other notebook where I can load the model and run inference?
Now is OK for the export, but when I open a new notebook, and I load my model, I have an error :