Skip to content

Call to Detections.__init__() missing 1 required positional argument: 'files' #5944

@yonomitt

Description

@yonomitt

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Detection

Bug

Calling .tolist() on a Detections object crashes with the following message:

  File "/****/.cache/torch/hub/ultralytics_yolov5_master/models/common.py", line 615, in <listcomp>
    x = [Detections([self.imgs[i]], [self.pred[i]], names=self.names, shape=self.s) for i in range(self.n)]
TypeError: __init__() missing 1 required positional argument: 'files'

There was a recent change (PR #5907), which fixed another bug. Unfortunately, it seems to have introduced this one.

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions