Can't get attribute 'ImageList' on <module ''

I know there is a similar question here about ImageItemList, but I seem to be having a reverse problem.

I trained my model on fastai 1.0.60 / torch 1.3.1 / torchvision 0.4.2 on one machine.
I’m trying to use that model for inference on a different machine - with the exact same versions of fastai / torch / torchvision.

Here’s the error I’m getting:

Traceback (most recent call last):
  File "/usr/local/bin/flask", line 8, in <module>
  File "/usr/local/lib/python3.6/site-packages/flask/", line 966, in main
    cli.main(prog_name="python -m flask" if as_module else None)
  File "/usr/local/lib/python3.6/site-packages/flask/", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask/", line 848, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/usr/local/lib/python3.6/site-packages/flask/", line 305, in __init__
  File "/usr/local/lib/python3.6/site-packages/flask/", line 330, in _load_unlocked
    self._app = rv = self.loader()
  File "/usr/local/lib/python3.6/site-packages/flask/", line 392, in load_app
    app = locate_app(self, import_name, None, raise_if_not_found=False)
  File "/usr/local/lib/python3.6/site-packages/flask/", line 240, in locate_app
  File "/Users/ilja/Documents/AI/jets_fastai/", line 8, in <module>
    model = load_learner('model','last_trained_model_1060.pkl')
  File "/usr/local/lib/python3.6/site-packages/fastai/", line 469, in load_learner
    state = torch.load(open(Path(path)/fname, 'rb'))
  File "/usr/local/lib/python3.6/site-packages/torch/", line 426, in load
    return _load(f, map_location, pickle_module, **pickle_load_args)
  File "/usr/local/lib/python3.6/site-packages/torch/", line 613, in _load
    result = unpickler.load()
AttributeError: Can't get attribute 'ImageList' on <module '' from '/usr/local/lib/python3.6/site-packages/fastai/vision/'>

Any help pls?:slight_smile: