-2

I am trying to build a Google Vision AI product search system. I am using python. I have uploaded a product set already.

However, when I would like to search the product set with python argparse using below python code, I got an error. https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/vision/cloud-client/product_search/product_set_management.py

The case was when I typed : python productsetmanagement.py --project_id="test-as-vision-api-v1" --location="asia-east1" list_product_sets

I could find my product_set : set01

However, when I typed : python productsetmanagement.py --project_id="test-as-vision-api-v1" --location="asia-east1" --product_set_id="set01" get_product_set

I got an error: the following arguments are required: product_set_id I have already typed the product set id, may I know why I still got the error? Did I use argparse incorrectly?

Many thanks.

Brendan
  • 1,017
  • 5
  • 7
Galaxy Lam
  • 53
  • 7
  • Don't post links to code. Just paste the **relevant** parts of the code here as formatted text. See [ask] and how to make a [mre] for more information – Tomerikoo Feb 05 '20 at 08:11

1 Answers1

0

The product_set_id is a positional argument. You would call it like this:

python productsetmanagement.py --project_id="test-as-vision-api-v1" --location="asia-east1" get_product_set "set01"

Brendan
  • 1,017
  • 5
  • 7