Skip to content

PyTorch 1.6 function name modification #555

@Lornatang

Description

@Lornatang

Error:

/home/unix/miniconda3/lib/python3.8/site-packages/torch/cuda/memory.py:344: FutureWarning: torch.cuda.memory_cached has been renamed to torch.cuda.memory_reserved

raw:

# for https://github.com/ultralytics/yolov5/blob/adaf1d8ac109f5c0977c27ceb3c2165a9c619cf2/train.py#L315
                mem = '%.3gG' % (torch.cuda.memory_cached() / 1E9 if torch.cuda.is_available() else 0)  # (GB)

new:

                mem = '%.3gG' % (torch.cuda.memory_reserved() / 1E9 if torch.cuda.is_available() else 0)  # (GB)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions