在Google云端上部署Google应用导致[错误13]

问题描述

我正在尝试部署一个flask应用程序,其目的是使用tensorflow通用编码器模型作为API来查找两个单词的相似性。

这是我的run.py文件

from flask import Flask,render_template,make_response,jsonify,request
import tensorflow_hub as hub
import numpy as np
import tensorflow as tf


module_url = "https://tfhub.dev/google/universal-sentence-encoder/4"
model = hub.load(module_url)
tf.keras.backend.clear_session()


app = Flask(__name__,template_folder='templates')


@app.route('/')
def menu():
    return render_template("index.html")


def semantic(search1,search2):
    comparison = model([search1,search2])
    return np.inner(comparison[0],comparison[1])


@app.route('/<search1>/<search2>',methods=['POST','GET'])
def deploy(search1,search2):
    compare = semantic(search1,search2)
    compare = compare*100
    compare = str(compare)
    compare = compare.strip("")
    response = {
        "Semantic Similarity": compare
    }
    if request.method == 'POST':
        return make_response(jsonify(response),200)
    else:
        return render_template("results.html",compare=compare)


if __name__ == "__main__":
    app.run(host="127.0.0.1",port=8080,debug=True)

这是我的app.yaml文件

entrypoint: "gunicorn -b:$PORT main:app"
env: flex
runtime: python
runtime_config: 
  python_version: 3

这是我运行命令将应用程序部署到云构建时返回的错误

gcloud应用部署


我不知道该错误意味着什么,我尝试查看文档和堆栈,但是该错误使我感到困惑。感谢您抽出宝贵的时间对此进行研究。
(gcloud.app.deploy) Error Response: [13] Flex operation projects/semanticapi/regions/us-central1/operations/e2e4b7ca-8422-4467-a3d1-283f20b42a10 error [INTERNAL]: An internal error occurred while processing task /app-engine-flex/insert_flex_deployment/flex_create_resources>2020-08-16T18:17:13.041Z81750.jf.0: Deployment Manager operation semanticapi/operation-1597601835196-5ad02a9e11fd3-f13606cb-82bdf048 errors: [code: "RESOURCE_ERROR"location: "/deployments/aef-default-20200816t180434/resources/aef-default-20200816t180434"message: "{\"ResourceType\":\"compute.beta.regionAutoscaler\",\"ResourceErrorCode\":\"403\",\"ResourceErrorMessage\":{\"code\":403,\"message\":\"The caller does not have permission\",\"status\":\"PERMISSION_DENIED\",\"statusMessage\":\"Forbidden\",\"requestPath\":\"https://compute.googleapis.com/compute/beta/projects/semanticapi/regions/us-central1/autoscalers\",\"httpMethod\":\"POST\"}}"]

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...