Change 1.0.46, re-exporting pkl with v 1.0.46 issue

Hi friends, using the template
replaced this
export_file_url = ‘
classes = [‘black’, ‘grizzly’, ‘teddys’]

with my own file and classes

original all good on render, mine fails with:

Mar 1 12:04:11 PM INFO[0073] RUN python app/
Mar 1 12:04:20 PM Traceback (most recent call last):
File “app/”, line 43, in
learn = loop.run_until_complete(asyncio.gather(*tasks))[0]
File “/usr/local/lib/python3.7/asyncio/”, line 584, in run_until_complete
return future.result()
File “app/”, line 31, in setup_learner
learn = load_learner(path, export_file_name)
File “/usr/local/lib/python3.7/site-packages/fastai/”, line 501, in load_learner
state = torch.load(Path(path)/fname, map_location=‘cpu’) if defaults.device == torch.device(‘cpu’) else torch.load(Path(path)/fname)
File “/usr/local/lib/python3.7/site-packages/torch/”, line 368, in load
return _load(f, map_location, pickle_module)
File “/usr/local/lib/python3.7/site-packages/torch/”, line 542, in _load
result = unpickler.load()
AttributeError: Can’t get attribute ‘ImageList’ on <module ‘’ from ‘/usr/local/lib/python3.7/site-packages/fastai/vision/’>
Mar 1 12:04:20 PM error building image: error building stage: waiting for process to exit: exit status 1
Mar 1 12:04:20 PM error: exit status 1

then I found on changes at 1.0.46 (2019-02-25)

load_learner will fail for exported (pickled) models with error “AttributeError: Can’t get attribute ‘ImageItemList’ on module ‘’”. You will need to re-export with version 1.0.46 or use 1.0.44

so in Google colab I ran this to update to latest version
!curl | bash

but I keep getting same error, any tips? thank u :wink:

just checked and Im running
Requirement already satisfied: fastai in /usr/local/lib/python3.6/dist-packages (1.0.46)
1.0.46 in google colab, and yet I’m still getting that error mmm,

error refers to Can’t get attribute ‘ImageList’ ,
change log refers to Can’t get attribute ‘ImageItemList’

so there’s something in there mm

1 Like

just fixed it, to make it work I added a
RUN pip install fastai --upgrade
RUN pip install --no-cache-dir -r requirements.txt --upgrade

in the dockerfile, and now it works, it uninstalls 45 and installs 46

Did you re-export the model with v1.0.46?

Looks like the pkl file in the export_file_url has not been updated to the latest version, so it’s not working

1 Like

hey Miko, thank you, yes I did, I checked and I exported it with 46, in any case I fixed it by
"adding a
RUN pip install fastai --upgrade
RUN pip install --no-cache-dir -r requirements.txt --upgrade

in the dockerfile, and now it works, it uninstalls 45 and installs 46"


Hi Javis

I have a similar problem, when I try to deploy the service manually (I earlier created the web service with the bear image problem, which I subsequently changed). I want to use your fix. But I am not sure what you mean by Docker file. I see Docker (which I chose as environment when I created the web service). But I am not sure how to access the associated Docker file. I am not really from a coding background, so this stuff is all a bit latin to me right now.

Any guidance is deeply appreciated!


sorry, I found the docker file and have added the above Run statement you specified. I can now see that it deployed the service. However, when I load an image and click on analyze, it doesn’t work. The error log file shows an error about Relu method not having the attribute Threshold. I also get lot of warnings about changes in all the methods in the source code.

Not sure how to ensure all these libraries are consistent. Any help appreciated!


1 Like

friends, I’m deep into part 2 and haven’t looked at this for quite a while (my render project not active anymore also since quite some time) but when I get back to it I will post here any updates :wink: