Problem deploying app using gcloud app engine

This is my error when I ran gcloud app deploy:

Traceback (most recent call last):
File “app/”, line 37, in
learn = loop.run_until_complete(asyncio.gather(*tasks))[0]
File “/usr/local/lib/python3.6/asyncio/”, line 484, in run_until_complete
return future.result()
File “app/”, line 32, in setup_learner
File “/usr/local/lib/python3.6/site-packages/fastai/”, line 267, in load
state = torch.load(source, map_location=device)
File “/usr/local/lib/python3.6/site-packages/torch/”, line 387, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File “/usr/local/lib/python3.6/site-packages/torch/”, line 564, in _load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, ‘<’.
The command ‘/bin/sh -c python app/’ returned a non-zero code: 1

Used this:

1 Like

I get the same error message when deploying. Any help appreciated!

Hi Olli,

Am on the same boat, you can refer:

It has more details that you can try, if not already.

Hope it might work for you!!

If it does, please share steps :slight_smile:



Hi Amit,

thanks. I tried these, and also increased the ‘app_start_timeout_sec’ to the max (3600), still got the timeout error.

Deployed the same model on Render and it works like a charm, first try. Would still be interested what is wrong in the gcloud.


1 Like

For me at least it turned out to be a disk space issue, solved by increasing the requested disk space in the app.yaml file, like this:

disk_size_gb: 12

12 GB seems to do the trick.