Type error can't pickle _thread.lock object learn.export()

I’m a very newbie here I’m in chapter two which I can’t export my model as in the video
here is an error

why could this happens??

is it because I didn’t download image as the instructor use the Bing API which I can’t so my download image code look like this


is that why I can’t export model??
thank you for your kindly answer :slight_smile:

1 Like

I really do not think it is because you downloaded the images differently. If you didn’t edit any other part of the code it should work. Have you tried restarting the whole notebook and running everything from the start?

yeah I did try it but it still can’t export :frowning:

I have been seeing this error also. I also used the bing dataloader and considered that it could be causing the issue, but I have reproduced this in a different notebook (and pip venv) loading the files directly from the directory and training a model.

I am using WSL and pip (with upstream pytorch installation instructions and pip install fastai)

EDIT: I wonder if some dependency snuck in a lock with an update? I could imagine environmental issue in my setup but if it shows up on collab that seems more like a bug?

Good news. I dug deeper on github and this issue was fixed in the latest version.

I was actually running in the old venv accidentally and switching to the one I created just now while troubleshooting fixed the problem. If you update your fastai library it should work for you.

2 Likes

thank you so much it’s definitely working

1 Like