GCP Docker错误:文件不驻留在使用–proto_path(或-I)指定的任何path中

我们正试图在GCP上承载tensorflow对象检测模型。 在运行“ gcloud app deploy ”之前,我们维护的是目录结构。 为了您的方便,我将这个问题连接到configuration文件。 Wer正在得到下面提到的部署错误。 请提出解决scheme。

  • +根
    • + object_detection /
    • +超薄/
    • + ENV
    • +的app.yaml
    • + Dockerfile
    • + requirement.txt
    • +的index.html
    • + test.py

Dockerfile

FROM gcr.io/google-appengine/python LABEL python_version=python2.7 RUN virtualenv --no-download /env -p python2.7 # Set virtualenv environment variables. This is equivalent to running # source /env/bin/activate ENV VIRTUAL_ENV /env ENV PATH /env/bin:$PATH # Various Python and C/build deps RUN apt-get update && apt-get install -y \ wget \ build-essential \ cmake \ git \ unzip \ pkg-config \ python-dev \ python-opencv \ libopencv-dev \ libav-tools \ libjpeg-dev \ libpng-dev \ libtiff-dev \ libjasper-dev \ libgtk2.0-dev \ python-numpy \ python-pycurl \ libatlas-base-dev \ gfortran \ webp \ python-opencv \ qt5-default \ libvtk6-dev \ zlib1g-dev \ protobuf-compiler \ python-pil python-lxml \ python-tk # Install Open CV - Warning, this takes absolutely forever ADD requirements.txt /app/ RUN pip install -r requirements.txt ADD . /app/ RUN protoc /app/object_detection/protos/*.proto --python_out=/app/. RUN export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/app/slim CMD exec gunicorn -b :$PORT UploadTest:app 

requirement.txt

 Flask==0.12.2 gunicorn==19.7.1 numpy==1.13.1 requests==0.11.1 bs4==0.0.1 nltk==3.2.1 pymysql==0.7.2 xlsxwriter==0.8.5 Pillow==4.2.1 pytesseract==0.1 opencv-python>=3.0 matplotlib==2.0.2 tensorflow==1.3.0 lxml==4.0.0 

的app.yaml

 runtime: custom env: flex entrypoint: gunicorn -b :$PORT UploadTest:app threadsafe: true runtime_config: python_version: 2 

毕竟,我用gcloud init发布 google云环境然后启动命令gcloud app deploy

我在部署解决scheme时遇到错误。

错误:

 Step 10/12 : RUN protoc /app/object_detection/protos/*.proto --python_out=/app/. ---> Running in 9b3ec9c43c2d /app/object_detection/protos/anchor_generator.proto: File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (eg absolute and relative) are equivalent (it's harder than you think). The command '/bin/sh -c protoc /app/object_detection/protos/*.proto --python_out=/app/.' returned a non-zero code: 1 ERROR ERROR: build step "gcr.io/cloud-builders/docker@sha256:a4a83be9b2fb61452e864ecf1bcfca99d1845499ef9500ae2905cea0ea593769" failed: exit status 1 ---------------------------------------------------------------------------------------------------------------------------------------------- ERROR: (gcloud.app.deploy) Cloud build failed. Check logs at https://console.cloud.google.com/gcr/builds/4dba3217-b7d6-4341-b28e-09a9dad45c18? 

有一个目录“object_detection / protos”存在,所有必要的文件都在那里。 仍然收到部署错误。 请在dockerfile中build议更改,以便成功部署它。

我的假设: GCP不能找出protc文件的path。 可能是我不得不改变Docketfile中的东西。 但无法弄清楚解决scheme。 请回答。

注意:这个设置在本地机器上运行良好。 但不能在GCP中工作