gcloud ai-platform prediction from standard JSON file ERROR: gcloud crashed (AttributeError): 'NoneType' object has no attribute 'framework'

gcloud ai-platform prediction from standard JSON file ERROR: gcloud crashed (AttributeError): 'NoneType' object has no attribute 'framework'

我正在尝试 运行 对 JSON 文件 records.json 的 ML 预测请求。

!gcloud ai-platform predict --model housing_prices --json-instances records.json

我收到以下错误。

Using endpoint [https://ml.googleapis.com/]
ERROR: gcloud crashed (AttributeError): 'NoneType' object has no attribute 'framework'

导入所有库。

import pandas as pd
import tensorflow as tf

我正在关注 qwiklabs lab 'Predict Housing Prices with Tensorflow and AI Platform'。所有命令都在 GCP 上使用 tensorflow 框架的 Jupyter notebook 中。我错过了一些东西。感谢任何帮助。

我设法解决了这个问题。 :) 感谢@john-hanley 指点我检查我可能遗漏的内容。

解析:

  • ssh 进入虚拟机(虽然由 GCP 管理)我更新了 gcloud 组件
  • $ gcloud components update
  • 我的预测命令!gcloud ai-platform predict --model housing_prices --json-instances records.json
  • 按预期抛出输出。
Using endpoint [https://ml.googleapis.com/]
PREDICTIONS
[24958.638671875]
[19435.654296875]