Search code examples
tensorflowgoogle-cloud-platformgcloudgcp-ai-platform-notebook

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


I am trying to run an ML prediction request on a JSON file records.json.

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

I am getting the following error.

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

All libraries are imported.

import pandas as pd
import tensorflow as tf

I am following a qwiklabs lab 'Predict Housing Prices with Tensorflow and AI Platform'. All commands are in Jupyter notebook on GCP using tensorflow framework. I am missing something. Any help is appreciated.


Solution

  • I managed to resolve the issue. :) Thanks @john-hanley for pointing me to check what I might have missed.

    Resolution:

    • ssh into the VM (although managed by GCP) I updated the gcloud components
    • $ gcloud components update
    • My prediction command !gcloud ai-platform predict --model housing_prices --json-instances records.json
    • Threw the output as expected.
    Using endpoint [https://ml.googleapis.com/]
    PREDICTIONS
    [24958.638671875]
    [19435.654296875]