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

查看:26
本文介绍了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.

但是,我收到以下错误:

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

我试过调试,但我在 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天全站免登陆