Skip to content

Detect(inplace=True) multithreaded detection RuntimeError #8565

@mynameischaos

Description

@mynameischaos

Search before asking

Question

torch version: 1.9.1

I use this scripts load model:

self.model = torch.hub.load('ultralytics/yolov5', 'custom', path=self.model_path)

then, run model(image) with single thread is ok.

then, run model(image) with multithread, but report this error:

File models/yolo.py", line 67, in forward
y[..., 0:2] = (y[..., 0:2] * 2 + self.grid[i]) * self.stride[i] # xy
RuntimeError: The size of tensor a (48) must match the size of tensor b (60) at non-singleton dimension 3

I follow the similar issues by set self.inplace = False, but it does not work.

Please help me.

Additional

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions