kitti_eval: fix a SyntaxError that makes evaluate.py unimportable - #5
Open
egeboy35 wants to merge 1 commit into
Open
kitti_eval: fix a SyntaxError that makes evaluate.py unimportable#5egeboy35 wants to merge 1 commit into
egeboy35 wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DeepDataMiningLearning/ngperception/detection/kitti_eval/evaluate.pycannot be parsed. Line 5 is:importtakes a dotted module path, not a relative one, so the file raises before a single statement runs —python -m ...kitti_eval.evaluateand anyfrom .evaluate import ...both die at import time:The change
One line. The relative form that binds the same name is:
which is also how the rest of the package imports its siblings —
eval.py:6isfrom .rotate_iou import rotate_iou_gpu_eval.Verification
python -m py_compileon the file fails before the change and succeeds after. Nothing else in the file is touched.🤖 Generated with Claude Code