Skip to content

NameError in MOT17 generate_reports.py caused by undefined config_file variable #399

@ARYANPATEL-BIT

Description

@ARYANPATEL-BIT

Description

In the MOT17 (multiedge_inference_bench/pedestrian_tracking) example, there is a bug in the error-handling logic of generate_reports.py. When a required configuration file is missing, the script attempts to print a helpful error message and cleanly exit. However, it references an undefined variable config_file, which causes an opaque NameError crash instead.

Root Cause

In examples/MOT17/multiedge_inference_bench/pedestrian_tracking/generate_reports.py (lines 77 and 86), the code references config_file in an f-string, but the correct local variables are tracking_config_file and reid_config_file.

Affected locations:

  • generate_reports.py:77f"...({config_file})..." should be f"...({tracking_config_file})..."
  • generate_reports.py:86f"...({config_file})..." should be f"...({reid_config_file})..."

Impact

It replaces an intended graceful system exit with a Python stack trace (NameError: name 'config_file' is not defined), making debugging difficult for developers when dealing with broken paths or missing files.

Expected Behavior

The script should cleanly print Could not find tracking config at (...) or Could not find reid config at (...) and exit.

Proposed Fix

Replace config_file with the appropriately scoped variables:

  1. On line 77: swap config_file for tracking_config_file
  2. On line 86: swap config_file for reid_config_file

Reproduction Steps

  1. Remove or point to a non-existent tracking/reid config file in the MOT17 example
  2. Run generate_reports.py
  3. Observe NameError instead of clean error message

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions