Google Prediction API,Hello Prediction:错误-参数太少 [英] Google Prediction API, Hello Prediction: error - Too few arguments

查看:114
本文介绍了Google Prediction API,Hello Prediction:错误-参数太少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天是我在Anaconda Python(Ubuntu Linux)上试用Google Prediction API的第一天.

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

我想尝试Hello Prediction入门代码 prediction.py 使用以下内容:

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.

但是,出现以下错误:

    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

我尝试调试,但是在argparse包方法中迷路了.

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

非常感谢您的帮助.

再现此代码的前提条件包括将数据上传到Google Storage.可以在此处找到步骤.

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

推荐答案

根据您应该使用的错误消息

According to the error message you should be using

$ python prediction.py mymodelid/mybucket myidentifier

它期望2个字符串,不带标志.

It expects 2 strings, without flags.

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

您还可以包括'--auth_host_hame = Joe'之类的值,但这在[]中,因此是可选的.使用行中没有"[--id 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.

这篇关于Google Prediction API,Hello Prediction:错误-参数太少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆