0

Today is my first day trying out Google Prediction API on Anaconda Python (Ubuntu Linux).

I wanted to try out the Hello Prediction starter code prediction.py using the following:

    $ python prediction.py --object_name="mymodelid/mybucket" --id="myidentifier"

exactly how it is advised in the code documentation.

However, I am getting the following error:

    usage: pred.py [-h] [--auth_host_name AUTH_HOST_NAME]
                   [--noauth_local_webserver]
                   [--auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]]
                   [--logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                   object_name id
    pred.py: error: too few arguments

I've tried debugging, but I get lost within the argparse package methods.

Any help is much appreciated.

EDIT: Prerequisites to reproduction of this code include uploading data to Google Storage. Steps can be found here.

Souradeep Sinha
  • 121
  • 1
  • 1
  • 10

1 Answers1

2

According to the error message you should be using

$ python prediction.py mymodelid/mybucket myidentifier

It expects 2 strings, without flags.

usage: pred.py [-h] [--auth_host_name AUTH_HOST_NAME]
               ...
               object_name id

You can also include values like '--auth_host_hame=Joe', but that's in [], so is optional. There isn't an '[--id ID]' term in the usage line.

hpaulj
  • 221,503
  • 14
  • 230
  • 353