Skip to content

Resolve Runtime Error: CUDA error: device side assert triggered. When setting class_weight #3864

@Laser-one

Description

@Laser-one

Describe the bug

When setting class_weight=[1.0,9.0], a CUDA error: device side assert triggered appears because during data_preprocessor, seg_map that smaller crop_size will be pad to crop_size with 255. This leads to the absence of class_weight[255] when class_weight=[1.0, 9.0].

Bug fix
The simplest method is to set seg_ pad_val=-1 in data_preprocessor.
Then, set ignore_index=seg_ pad_val=-1 in decode_ head and/or auxiliary_head.
In addition, in order to avoid the loss of average coefficients and consider padding labels, set avg_non_ignore=True in loss_decode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions