Keras google cloudml sample: Prediction failed

217 Views Asked by At

I'm trying the keras cloudml sample (https://github.com/GoogleCloudPlatform/cloudml-samples/tree/master/census/keras) and after a bug fix (Keras google cloudml sample: IndexError) the cloud training works and I can successfully create a model, but I still cannot get the cloud predictions to work.

I've looked for a solution on stackexchange, google and read https://cloud.google.com/ml-engine/docs/how-tos/troubleshooting

See below for environment, model, predict call and error.

I'm a still a noob, so it might well be I'm erring in some naive way.

Any help is appreciated,

yarc68000

------------ model ---------------

$ gcloud ml-engine models list
NAME                            DEFAULT_VERSION_NAME
j171011_census1_model         v1

------------predict and error --------------

$ gcloud ml-engine predict --model j171011_census1_model --version v1 --json-instances ../test.json
{
  "error": "Prediction failed: Expected tensor name: input, got tensor name: [u'hours_per_week', u'native_country', u'relationship', u'gender', u'age', u'marital_status', u'race', u'education_num', u'workclass', u'capital_loss', u'education', u'capital_gain', u'occupation']."
}

----------- environment ----------------

(env1) $ python --version
Python 2.7.13 :: Continuum Analytics, Inc.
(env1) $ conda list | grep 'h5py\|keras\|pandas\|numexpr\|tensorflow'
h5py                      2.7.1                    py27_1    conda-forge
keras                     2.0.6                    py27_0    conda-forge
numexpr                   2.6.2                    py27_1    conda-forge
pandas                    0.20.3                   py27_0    anaconda
tensorflow                1.3.0                     <pip>
tensorflow-tensorboard    0.1.6                     <pip>
0

There are 0 best solutions below