我尝试使用邮递员的HTTP API 方法在我部署的一个模型上调用预测请求,我得到了这个作为响应:
{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity /sign-in/web/devconsole-project .", "status": "UNAUTHENTICATED" } }
我意识到我们需要身份验证,所以我尝试使用 Firebase Cloud Functions 进行相同的 HTTP 调用,但仍然得到与上述相同的响应。我做了一些挖掘,发现了所有可以与云功能一起使用的服务,我在其中看到了 ML Engine。
我在模型的权限选项卡中将 Cloud Functions 服务帐户添加为 ML Engine Owner,希望它添加 API 调用所需的身份验证,但仍然无法正常工作。
我不想同样使用 cli 或 python-client-library,目的是使这项工作无服务器。
谁能帮助我了解为什么会发生这种情况,或者我还能如何对预测请求进行 HTTP 调用?
谢谢。