Skip to content
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

objectron Python example is broken #2557

Closed
emilk opened this issue Jun 28, 2023 · 2 comments
Closed

objectron Python example is broken #2557

emilk opened this issue Jun 28, 2023 · 2 comments
Labels
🪳 bug Something isn't working examples Issues relating to the Rerun examples 🐍 Python API Python logging API

Comments

@emilk
Copy link
Member

emilk commented Jun 28, 2023

❯ python --version
Python 3.8.12

❯ pip install -r examples/python/objectron/requirements.txt
…

❯ examples/python/objectron/main.py                        
DEV ENVIRONMENT DETECTED! Re-importing rerun from: /Users/emilk/code/rerun/rerun/rerun_py/rerun_sdk
DEV ENVIRONMENT DETECTED! Re-importing rerun from: /Users/emilk/code/rerun/rerun/rerun_py/rerun_sdk
loading annotations from /Users/emilk/code/rerun/rerun/examples/python/objectron/dataset/book/batch-20/35/annotation.pbdata
Traceback (most recent call last):
  File "examples/python/objectron/main.py", line 294, in <module>
    main()
  File "examples/python/objectron/main.py", line 287, in main
    seq = read_annotations(dir)
  File "examples/python/objectron/main.py", line 101, in read_annotations
    seq = Sequence().parse(data)
  File "<string>", line 5, in __init__
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 528, in __post_init__
    setattr(self, field.name, self._get_field_default(field, meta))
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 652, in _get_field_default
    return self._betterproto.default_gen[field.name]()
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 563, in _betterproto
    meta = ProtoClassMetadata(self.__class__)
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 457, in __init__
    self.init_default_gen()
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 465, in init_default_gen
    default_gen[field.name] = self.cls._get_field_default_gen(field, meta)
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 658, in _get_field_default_gen
    t = cls._type_hint(field.name)
  File "/Users/emilk/code/rerun/rerun/venv/lib/python3.8/site-packages/betterproto/__init__.py", line 640, in _type_hint
    type_hints = get_type_hints(cls, vars(module))
  File "/Users/emilk/.pyenv/versions/3.8.12/lib/python3.8/typing.py", line 1232, in get_type_hints
    value = _eval_type(value, base_globals, localns)
  File "/Users/emilk/.pyenv/versions/3.8.12/lib/python3.8/typing.py", line 270, in _eval_type
    return t._evaluate(globalns, localns)
  File "/Users/emilk/.pyenv/versions/3.8.12/lib/python3.8/typing.py", line 518, in _evaluate
    eval(self.__forward_code__, globalns, localns),
  File "<string>", line 1, in <module>
TypeError: 'type' object is not subscriptable
@emilk emilk added 🪳 bug Something isn't working 🐍 Python API Python logging API examples Issues relating to the Rerun examples labels Jun 28, 2023
@emilk emilk changed the title objectron example is broken objectron Python example is broken Jun 28, 2023
@emilk
Copy link
Member Author

emilk commented Jun 28, 2023

It used to work. Maybe it broke because we don't freeze pip package versions?

emilk pushed a commit that referenced this issue Jun 28, 2023
### What

The change from List -> list was introduced as part of:
 - #2361
 
However it seems to break objectron on python3.8:
 - #2557

Reverting just this bit causes it to work for me, though I don't fully
understand the intention or ramifications.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested https://demo.rerun.io/pr/2559 (if applicable)

<!-- This line will get updated when the PR build summary job finishes.
-->
PR Build Summary: https://build.rerun.io/pr/2559

<!-- pr-link-docs:start -->
Docs preview: https://rerun.io/preview/4073c08/docs
Examples preview: https://rerun.io/preview/4073c08/examples
<!-- pr-link-docs:end -->
@emilk
Copy link
Member Author

emilk commented Jun 28, 2023

Closed by #2559

@emilk emilk closed this as completed Jun 28, 2023
emilk pushed a commit that referenced this issue Jun 29, 2023
### What

The change from List -> list was introduced as part of:
 - #2361
 
However it seems to break objectron on python3.8:
 - #2557

Reverting just this bit causes it to work for me, though I don't fully
understand the intention or ramifications.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested https://demo.rerun.io/pr/2559 (if applicable)

<!-- This line will get updated when the PR build summary job finishes.
-->
PR Build Summary: https://build.rerun.io/pr/2559

<!-- pr-link-docs:start -->
Docs preview: https://rerun.io/preview/4073c08/docs
Examples preview: https://rerun.io/preview/4073c08/examples
<!-- pr-link-docs:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working examples Issues relating to the Rerun examples 🐍 Python API Python logging API
Projects
None yet
Development

No branches or pull requests

1 participant