Skip to content

GPU usage out of memory #9320

@cqray1990

Description

@cqray1990

Search before asking

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

YOLOv5 Component

No response

Bug

total classes nc is 7500:
when train mode first GPU usage is as follows:
Epoch gpu_mem box obj cls total labels img_size
0/299 4.11G 0.05746 3.93 65.8
after a moment:
Epoch gpu_mem box obj cls total labels img_size
0/299 8.21G 0.05746 3.93 65.8
and then

Epoch gpu_mem box obj cls total labels img_size
0/299 15.1G 0.05746 3.93 65.8

and then Epoch gpu_mem box obj cls total labels img_size
0/299 18.6 G 0.05746 3.93 65.8

why GPU usage memory is increased,that's unreasonable

and as last rasie gpu out of memory

but when use class number nc =4, it is normal, it is related to the class number? or because of so large class bumber?
after training per epoch,the usage memory increased util raise error GPU out memory, and it is not memory leak because when class number nc=4,it can training normal,except class number nc=7500

Environment

enviroment:
two 3090ti
cuda 11.3
cudnn 8.2.3
pytorch 1.8.1 also try 1.12 ,1.11

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

    StaleStale and schedule for closing soonbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions