Skip to content

yolov4.py index error #3

@shayan-boghani

Description

@shayan-boghani

When running yolov4.py I received an error:

File "mypath", line 31, in <module>
    label = "%s : %f" % (class_name[classid[0]], score)
                                    ~~~~~~~^^^
IndexError: invalid index to scalar variable.

I believe it is related to line 31 in yolov4.py:

label = "%s : %f" % (class_name[classid[0]], score)

classid is indexed to get a value to pass to the class_name matrix, however classid is a scalar. I believe I corrected this by changing line 31 to:

label = "%s : %f" % (class_name[classid], score)

Please let me know if this is correct from your understanding or if I set something up wrong for this error to occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions