Google Prediction API, Hello Prediction: error - Too few arguments

跟風遠走 提交于 2019-12-11 23:17:37

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/30638974/google-prediction-api-hello-prediction-error-too-few-arguments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!