Skip to content

faces.py error #8843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ichengzi opened this issue Dec 30, 2022 · 0 comments · Fixed by #8844
Closed

faces.py error #8843

ichengzi opened this issue Dec 30, 2022 · 0 comments · Fixed by #8844
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ichengzi
Copy link
Contributor

In which file did you encounter the issue?

vision/snippets/face_detection/faces.py

Did you change the file? If so, how?

yes . add type=int

Describe the issue

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/proto/marshal/rules/message.py", line 36, in to_proto
    return self._descriptor(**value)
TypeError: 'str' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/test/python-docs-samples/vision/snippets/face_detection/./faces.py", line 104, in <module>
    main(args.input_image, args.output, args.max_results)
  File "/home/test/python-docs-samples/vision/snippets/face_detection/./faces.py", line 80, in main
    faces = detect_face(image, max_results)
  File "/home/test/python-docs-samples/vision/snippets/face_detection/./faces.py", line 44, in detect_face
    return client.face_detection(
  File "/usr/local/lib/python3.9/dist-packages/google/cloud/vision_helpers/decorators.py", line 112, in inner
    response = self.annotate_image(
  File "/usr/local/lib/python3.9/dist-packages/google/cloud/vision_helpers/__init__.py", line 76, in annotate_image
    r = self.batch_annotate_images(
  File "/usr/local/lib/python3.9/dist-packages/google/cloud/vision_v1/services/image_annotator/client.py", line 537, in batch_annotate_images
    requests[i] = image_annotator.AnnotateImageRequest(requests[i])
  File "/usr/local/lib/python3.9/dist-packages/proto/message.py", line 570, in __init__
    pb_value = marshal.to_proto(pb_type, value)
  File "/usr/local/lib/python3.9/dist-packages/proto/marshal/marshal.py", line 198, in to_proto
    return type(value)(self.to_proto(proto_type, i) for i in value)
  File "/usr/local/lib/python3.9/dist-packages/proto/marshal/marshal.py", line 198, in <genexpr>
    return type(value)(self.to_proto(proto_type, i) for i in value)
  File "/usr/local/lib/python3.9/dist-packages/proto/marshal/marshal.py", line 217, in to_proto
    pb_value = rule.to_proto(value)
  File "/usr/local/lib/python3.9/dist-packages/proto/marshal/rules/message.py", line 41, in to_proto
    return self._wrapper(value)._pb
  File "/usr/local/lib/python3.9/dist-packages/proto/message.py", line 604, in __init__
    super().__setattr__("_pb", self._meta.pb(**params))
TypeError: 'str' object cannot be interpreted as an integer
@ichengzi ichengzi added priority: p2 Moderately-important priority. Fix may not be included in next release. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Dec 30, 2022
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Dec 30, 2022
This was referenced Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants