Mezo
Mezo

Reputation: 43

How to add pytorch library to Google App Engine

I'm trying to add torch==1.7.0+cpu and torchvision==0.8.1+cpu libraries to GAE,

from my OS I can use pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html to install them, but on google app engine deployment it takes libraries from requirements.txt only.

I tried downloading them to a lib folder via pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html -t lib/ and adding to appengine_config.py

from google.appengine.ext import vendor
vendor.add('lib')

but I keep getting This deployment has too many files. New versions are limited to 10000 files for this app.,

any ideas on how can I achieve this?

Upvotes: 1

Views: 652

Answers (1)

Mezo
Mezo

Reputation: 43

I was able to achieve this by editing the requirements.txt file to:

-f https://download.pytorch.org/whl/torch_stable.html
torch==1.7.0+cpu
torchvision==0.8.1+cpu

Upvotes: 2

Related Questions