Skip to content

kitti_eval: fix a SyntaxError that makes evaluate.py unimportable - #5

Open
egeboy35 wants to merge 1 commit into
lkk688:mainfrom
egeboy35:fix/kitti-eval-import-syntax
Open

kitti_eval: fix a SyntaxError that makes evaluate.py unimportable#5
egeboy35 wants to merge 1 commit into
lkk688:mainfrom
egeboy35:fix/kitti-eval-import-syntax

Conversation

@egeboy35

Copy link
Copy Markdown

DeepDataMiningLearning/ngperception/detection/kitti_eval/evaluate.py cannot be parsed. Line 5 is:

import .kitti_common as kitti

import takes a dotted module path, not a relative one, so the file raises before a single statement runs — python -m ...kitti_eval.evaluate and any from .evaluate import ... both die at import time:

  File ".../kitti_eval/evaluate.py", line 5
    import .kitti_common as kitti
           ^
SyntaxError: invalid syntax

The change

One line. The relative form that binds the same name is:

from . import kitti_common as kitti

which is also how the rest of the package imports its siblings — eval.py:6 is from .rotate_iou import rotate_iou_gpu_eval.

Verification

python -m py_compile on the file fails before the change and succeeds after. Nothing else in the file is touched.

🤖 Generated with Claude Code

Line 5 reads

    import .kitti_common as kitti

which is not valid Python -- `import` takes a dotted module path, not a
relative one. The file cannot be parsed, so `python -m ...kitti_eval.evaluate`
and any `from .evaluate import ...` fail before a single statement runs:

    File ".../kitti_eval/evaluate.py", line 5
      import .kitti_common as kitti
             ^
    SyntaxError: invalid syntax

The relative form is `from . import kitti_common as kitti`, which binds the
same name and matches how the rest of the package imports its siblings
(eval.py:6 `from .rotate_iou import rotate_iou_gpu_eval`).

Verified: `python -m py_compile` on the file fails before the change and
succeeds after; the AST shows a level-1 ImportFrom binding `kitti`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants