Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么将BNNeck与Focal Loss结合? #214

Open
bmxbmx3 opened this issue May 11, 2022 · 0 comments
Open

怎么将BNNeck与Focal Loss结合? #214

bmxbmx3 opened this issue May 11, 2022 · 0 comments

Comments

@bmxbmx3
Copy link

bmxbmx3 commented May 11, 2022

我尝试将您在reid-strong-baseline/modeling/baseline.py下关于bnneck的部分代码移植到mmclassification中,因为做的是细粒度图像分类,这里采用mmclassification的focal loss解决样本不平衡的问题。
mmclassification中的focal loss代码如下:

# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
import torch.nn.functional as F

from ..builder import LOSSES
from .utils import convert_to_one_hot, weight_reduce_loss


def sigmoid_focal_loss(pred,
                       target,
                       weight=None,
                       gamma=2.0,
                       alpha=0.25,
                       reduction='mean',
                       avg_factor=None):
    r"""Sigmoid focal loss.

    Args:
        pred (torch.Tensor): The prediction with shape (N, \*).
        target (torch.Tensor): The ground truth label of the prediction with
            shape (N, \*).
        weight (torch.Tensor, optional): Sample-wise loss weight with shape
            (N, ). Defaults to None.
        gamma (float): The gamma for calculating the modulating factor.
            Defaults to 2.0.
        alpha (float): A balanced form for Focal Loss. Defaults to 0.25.
        reduction (str): The method used to reduce the loss.
            Options are "none", "mean" and "sum". If reduction is 'none' ,
            loss is same shape as pred and label. Defaults to 'mean'.
        avg_factor (int, optional): Average factor that is used to average
            the loss. Defaults to None.

    Returns:
        torch.Tensor: Loss.
    """
    assert pred.shape == \
           target.shape, 'pred and target should be in the same shape.'
    pred_sigmoid = pred.sigmoid()
    target = target.type_as(pred)
    pt = (1 - pred_sigmoid) * target + pred_sigmoid * (1 - target)
    focal_weight = (alpha * target + (1 - alpha) *
                    (1 - target)) * pt.pow(gamma)
    loss = F.binary_cross_entropy_with_logits(
        pred, target, reduction='none') * focal_weight
    if weight is not None:
        assert weight.dim() == 1
        weight = weight.float()
        if pred.dim() > 1:
            weight = weight.reshape(-1, 1)
    loss = weight_reduce_loss(loss, weight, reduction, avg_factor)
    return loss


@LOSSES.register_module()
class FocalLoss(nn.Module):
    """Focal loss.

    Args:
        gamma (float): Focusing parameter in focal loss.
            Defaults to 2.0.
        alpha (float): The parameter in balanced form of focal
            loss. Defaults to 0.25.
        reduction (str): The method used to reduce the loss into
            a scalar. Options are "none" and "mean". Defaults to 'mean'.
        loss_weight (float): Weight of loss. Defaults to 1.0.
    """

    def __init__(self,
                 gamma=2.0,
                 alpha=0.25,
                 reduction='mean',
                 loss_weight=1.0):
        super(FocalLoss, self).__init__()
        self.gamma = gamma
        self.alpha = alpha
        self.reduction = reduction
        self.loss_weight = loss_weight

    def forward(self,
                pred,
                target,
                weight=None,
                avg_factor=None,
                reduction_override=None):
        r"""Sigmoid focal loss.

        Args:
            pred (torch.Tensor): The prediction with shape (N, \*).
            target (torch.Tensor): The ground truth label of the prediction
                with shape (N, \*), N or (N,1).
            weight (torch.Tensor, optional): Sample-wise loss weight with shape
                (N, \*). Defaults to None.
            avg_factor (int, optional): Average factor that is used to average
                the loss. Defaults to None.
            reduction_override (str, optional): The method used to reduce the
                loss into a scalar. Options are "none", "mean" and "sum".
                Defaults to None.

        Returns:
            torch.Tensor: Loss.
        """
        assert reduction_override in (None, 'none', 'mean', 'sum')
        reduction = (
            reduction_override if reduction_override else self.reduction)
        if target.dim() == 1 or (target.dim() == 2 and target.shape[1] == 1):
            target = convert_to_one_hot(target.view(-1, 1), pred.shape[-1])
        loss_cls = self.loss_weight * sigmoid_focal_loss(
            pred,
            target,
            weight,
            gamma=self.gamma,
            alpha=self.alpha,
            reduction=reduction,
            avg_factor=avg_factor)
        return loss_cls

我训练的时候focal loss都按官方给的参数默认配置,即gamma=2.0,alpha=0.25。除此之外,batchsize是64,类别数是9691。
我发现,以Resnet50做beckbone,如果加入BNNeck,将BNNeck的fc层产生的特征作为pred导入到上述focal loss代码中的sigmoid_focal_loss()函数,训练生成的结果如下:

2022-05-11 16:50:54,326 - mmcls - INFO - Epoch [1][100/2218]	lr: 3.000e-04, eta: 18:09:28, time: 0.369, data_time: 0.043, memory: 6122, loss: 1275.0930
2022-05-11 16:51:26,590 - mmcls - INFO - Epoch [1][200/2218]	lr: 3.000e-04, eta: 17:00:57, time: 0.323, data_time: 0.000, memory: 6122, loss: 1259.5756
2022-05-11 16:51:58,853 - mmcls - INFO - Epoch [1][300/2218]	lr: 3.000e-04, eta: 16:37:43, time: 0.323, data_time: 0.000, memory: 6122, loss: 1259.6599
2022-05-11 16:52:31,123 - mmcls - INFO - Epoch [1][400/2218]	lr: 3.000e-04, eta: 16:25:55, time: 0.323, data_time: 0.000, memory: 6122, loss: 1259.7178

这里加了BNNeck的代码(修改了mmclassification相应head代码)如下:

# Copyright (c) OpenMMLab. All rights reserved.

"""
follow <A strong tricks and a strong baseline for deep person re-identification.(cvprw2019,oral)>
"""
import torch
import torch.nn as nn
import torch.nn.functional as F

from ..builder import HEADS
from .cls_head import ClsHead


def weights_init_kaiming(m):
    classname = m.__class__.__name__
    if classname.find('Linear') != -1:
        nn.init.kaiming_normal_(m.weight, a=0, mode='fan_out')
        nn.init.constant_(m.bias, 0.0)
    elif classname.find('Conv') != -1:
        nn.init.kaiming_normal_(m.weight, a=0, mode='fan_in')
        if m.bias is not None:
            nn.init.constant_(m.bias, 0.0)
    elif classname.find('BatchNorm') != -1:
        if m.affine:
            nn.init.constant_(m.weight, 1.0)
            nn.init.constant_(m.bias, 0.0)


def weights_init_classifier(m):
    classname = m.__class__.__name__
    if classname.find('Linear') != -1:
        nn.init.normal_(m.weight, std=0.001)
        if m.bias:
            nn.init.constant_(m.bias, 0.0)


@HEADS.register_module()
class FcBnnLinearClsHead(ClsHead):
    """Linear classifier head.

    Args:
        num_classes (int): Number of categories excluding the background
            category.
        in_channels (int): Number of channels in the input feature map.
        init_cfg (dict | optional): The extra init config of layers.
            Defaults to use dict(type='Normal', layer='Linear', std=0.01).
    """

    def __init__(self,
                 num_classes,
                 in_channels,
                 init_cfg=dict(type='Normal', layer='Linear', std=0.01),
                 *args,
                 **kwargs):
        super(FcBnnLinearClsHead, self).__init__(init_cfg=init_cfg, *args, **kwargs)

        self.in_channels = in_channels
        self.num_classes = num_classes

        if self.num_classes <= 0:
            raise ValueError(
                f'num_classes={num_classes} must be a positive integer')

        # bnn neck
        self.bottleneck = nn.BatchNorm1d(self.in_channels)
        self.bottleneck.bias.requires_grad_(False)  # no shift
        self.fc = nn.Linear(self.in_channels, self.num_classes, bias=False)  # fc layer

        self.bottleneck.apply(weights_init_kaiming)
        self.fc.apply(weights_init_classifier)

    def pre_logits(self, x):
        if isinstance(x, tuple):
            x = x[-1]
        return x

    def simple_test(self, x, softmax=True, post_process=True):
        """Inference without augmentation.

        Args:
            x (tuple[Tensor]): The input features.
                Multi-stage inputs are acceptable but only the last stage will
                be used to classify. The shape of every item should be
                ``(num_samples, in_channels)``.
            softmax (bool): Whether to softmax the classification score.
            post_process (bool): Whether to do post processing the
                inference results. It will convert the output to a list.

        Returns:
            Tensor | list: The inference results.

                - If no post processing, the output is a tensor with shape
                  ``(num_samples, num_classes)``.
                - If post processing, the output is a multi-dimentional list of
                  float and the dimensions are ``(num_samples, num_classes)``.
        """
        x = self.pre_logits(x)
        cls_score = self.fc(x)

        if softmax:
            pred = (
                F.softmax(cls_score, dim=1) if cls_score is not None else None)
        else:
            pred = cls_score

        if post_process:
            return self.post_process(pred)
        else:
            return pred

    def forward_train(self, x, gt_label, **kwargs):

        x = self.pre_logits(x)
        feat = self.bottleneck(x)  # normalize for angular softmax
        cls_score = self.fc(feat)

        cat_score = torch.cat((x, cls_score), dim=1)  # connect no fc and fc score

        losses = self.loss(cat_score, gt_label, **kwargs)
        return losses

如果不加BNNeck,直接将Resnet50的fc层输出特征作为pred导入到之前focal loss代码中的sigmoid_focal_loss()函数,训练生成的结果如下:

2022-05-11 17:03:48,340 - mmcls - INFO - Epoch [1][100/2218]	lr: 3.000e-04, eta: 18:04:42, time: 0.367, data_time: 0.041, memory: 6122, loss: 27.5292
2022-05-11 17:04:20,709 - mmcls - INFO - Epoch [1][200/2218]	lr: 3.000e-04, eta: 17:00:08, time: 0.324, data_time: 0.002, memory: 6122, loss: 0.9983
2022-05-11 17:04:53,292 - mmcls - INFO - Epoch [1][300/2218]	lr: 3.000e-04, eta: 16:40:20, time: 0.326, data_time: 0.004, memory: 6122, loss: 0.9925

这里不加BNNeck的代码(修改了mmclassification相应head代码)如下:

# Copyright (c) OpenMMLab. All rights reserved.

"""
no fc layer
"""
import torch
import torch.nn as nn
import torch.nn.functional as F

from ..builder import HEADS
from .cls_head import ClsHead


@HEADS.register_module()
class FcLinearClsHead(ClsHead):
    """Linear classifier head.

    Args:
        num_classes (int): Number of categories excluding the background
            category.
        in_channels (int): Number of channels in the input feature map.
        init_cfg (dict | optional): The extra init config of layers.
            Defaults to use dict(type='Normal', layer='Linear', std=0.01).
    """

    def __init__(self,
                 num_classes,
                 in_channels,
                 init_cfg=dict(type='Normal', layer='Linear', std=0.01),
                 *args,
                 **kwargs):
        super(FcLinearClsHead, self).__init__(init_cfg=init_cfg, *args, **kwargs)

        self.in_channels = in_channels
        self.num_classes = num_classes

        if self.num_classes <= 0:
            raise ValueError(
                f'num_classes={num_classes} must be a positive integer')

        self.fc = nn.Linear(self.in_channels, self.num_classes)  # fc layer

    def pre_logits(self, x):
        if isinstance(x, tuple):
            x = x[-1]
        return x

    def simple_test(self, x, softmax=True, post_process=True):
        """Inference without augmentation.

        Args:
            x (tuple[Tensor]): The input features.
                Multi-stage inputs are acceptable but only the last stage will
                be used to classify. The shape of every item should be
                ``(num_samples, in_channels)``.
            softmax (bool): Whether to softmax the classification score.
            post_process (bool): Whether to do post processing the
                inference results. It will convert the output to a list.

        Returns:
            Tensor | list: The inference results.

                - If no post processing, the output is a tensor with shape
                  ``(num_samples, num_classes)``.
                - If post processing, the output is a multi-dimentional list of
                  float and the dimensions are ``(num_samples, num_classes)``.
        """
        x = self.pre_logits(x)
        cls_score = self.fc(x)

        if softmax:
            pred = (
                F.softmax(cls_score, dim=1) if cls_score is not None else None)
        else:
            pred = cls_score

        if post_process:
            return self.post_process(pred)
        else:
            return pred

    def forward_train(self, x, gt_label, **kwargs):
        x = self.pre_logits(x)
        cls_score = self.fc(x)

        cat_score = torch.cat((x, cls_score), dim=1)  # connect no fc and fc score

        losses = self.loss(cat_score, gt_label, **kwargs)
        return losses

我仔细检查了加入BNNeck的移植代码部分,确定没有问题后,有个疑问,就是为什么加入了BNNeck所训练出的focal loss是1000多?相比不加BNNeck的差别巨大?我的conda环境配置如下:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    https://repo.anaconda.com/pkgs/main
_openmp_mutex             4.5                       1_gnu    https://repo.anaconda.com/pkgs/main
absl-py                   1.0.0                    pypi_0    pypi
addict                    2.4.0                    pypi_0    pypi
albumentations            1.1.0                    pypi_0    pypi
appdirs                   1.4.4                    pypi_0    pypi
asynctest                 0.13.0                     py_0    defaults
attributee                0.1.5                    pypi_0    pypi
attrs                     18.1.0                   pypi_0    pypi
beautifulsoup4            4.11.1                   pypi_0    pypi
blas                      1.0                         mkl    defaults
brotlipy                  0.7.0           py37h27cfd23_1003    defaults
bzip2                     1.0.8                h7b6447c_0    defaults
ca-certificates           2022.3.29            h06a4308_1    defaults
cachetools                5.0.0                    pypi_0    pypi
certifi                   2021.10.8        py37h06a4308_2    defaults
cffi                      1.15.0           py37h7f8727e_0    defaults
charset-normalizer        2.0.12                   pypi_0    pypi
cityscapesscripts         2.2.0                    pypi_0    pypi
click                     7.1.2                    pypi_0    pypi
codecov                   2.1.11             pyhd3eb1b0_0    defaults
colorama                  0.4.4              pyhd3eb1b0_0    defaults
coloredlogs               15.0.1                   pypi_0    pypi
commonmark                0.9.1              pyhd3eb1b0_0    defaults
coverage                  6.3.2            py37h7f8727e_0    defaults
cryptography              36.0.0           py37h9ce1e76_0    defaults
cudatoolkit               10.2.89              hfd86e86_1    defaults
cycler                    0.11.0                   pypi_0    pypi
cython                    0.29.28                  pypi_0    pypi
dataclasses               0.8                pyh6d0b6a4_7    defaults
dotty-dict                1.3.0                    pypi_0    pypi
efficientnet-pytorch      0.7.1                    pypi_0    pypi
ffmpeg                    4.3                  hf484d3e_0    pytorch
filelock                  3.6.0                    pypi_0    pypi
flake8                    4.0.1              pyhd3eb1b0_1    defaults
flake8-import-order       0.18.1                   pypi_0    pypi
flatbuffers               2.0                      pypi_0    pypi
fonttools                 4.31.2                   pypi_0    pypi
freetype                  2.11.0               h70c0345_0    defaults
future                    0.18.2                   py37_1    defaults
gdown                     4.4.0                    pypi_0    pypi
giflib                    5.2.1                h7b6447c_0    defaults
gmp                       6.2.1                h2531618_2    defaults
gnutls                    3.6.15               he1e5248_0    defaults
google-auth               2.6.2                    pypi_0    pypi
google-auth-oauthlib      0.4.6                    pypi_0    pypi
grpcio                    1.45.0                   pypi_0    pypi
humanfriendly             10.0                     pypi_0    pypi
idna                      3.3                pyhd3eb1b0_0    defaults
imagecorruptions          1.1.2                    pypi_0    pypi
imageio                   2.16.1                   pypi_0    pypi
importlib-metadata        4.11.3           py37h06a4308_0    defaults
importlib_metadata        4.11.3               hd3eb1b0_0    defaults
iniconfig                 1.1.1              pyhd3eb1b0_0    defaults
instaboostfast            0.1.2                    pypi_0    pypi
intel-openmp              2021.4.0          h06a4308_3561    defaults
interrogate               1.5.0                    pypi_0    pypi
isort                     4.3.21                   py37_0    defaults
joblib                    1.1.0                    pypi_0    pypi
jpeg                      9b                            0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
kiwisolver                1.4.2                    pypi_0    pypi
kwarray                   0.6.0                    pypi_0    pypi
lame                      3.100                h7b6447c_0    defaults
lap                       0.4.0                    pypi_0    pypi
lcms2                     2.12                 h3be6417_0    defaults
libedit                   3.1.20210910         h7f8727e_0    https://repo.anaconda.com/pkgs/main
libffi                    3.2.1             hf484d3e_1007    https://repo.anaconda.com/pkgs/main
libgcc-ng                 9.3.0               h5101ec6_17    https://repo.anaconda.com/pkgs/main
libgomp                   9.3.0               h5101ec6_17    https://repo.anaconda.com/pkgs/main
libiconv                  1.15                 h63c8f33_5    defaults
libidn2                   2.3.2                h7f8727e_0    defaults
libpng                    1.6.37               hbc83047_0    defaults
libstdcxx-ng              9.3.0               hd4cf53a_17    https://repo.anaconda.com/pkgs/main
libtasn1                  4.16.0               h27cfd23_0    defaults
libtiff                   4.2.0                h85742a9_0    defaults
libunistring              0.9.10               h27cfd23_0    defaults
libuv                     1.40.0               h7b6447c_0    defaults
libwebp                   1.2.0                h89dd481_0    defaults
libwebp-base              1.2.0                h27cfd23_0    defaults
lvis                      0.5.3                    pypi_0    pypi
lz4-c                     1.9.3                h295c915_1    defaults
markdown                  3.3.6                    pypi_0    pypi
matplotlib                3.5.1                    pypi_0    pypi
mccabe                    0.6.1                    pypi_0    pypi
mkl                       2021.4.0           h06a4308_640    defaults
mkl-service               2.4.0            py37h7f8727e_0    defaults
mkl_fft                   1.3.1            py37hd3c417c_0    defaults
mkl_random                1.2.2            py37h51133e4_0    defaults
mmcls                     0.22.0                    dev_0    <develop>
mmcv-full                 1.4.8                    pypi_0    pypi
mmdet                     2.23.0                    dev_0    <develop>
mmtrack                   0.12.0                   pypi_0    pypi
model-index               0.1.11                   pypi_0    pypi
motmetrics                1.2.0                    pypi_0    pypi
munch                     2.5.0                    pypi_0    pypi
ncurses                   6.3                  h7f8727e_2    https://repo.anaconda.com/pkgs/main
nettle                    3.7.3                hbbd107a_1    defaults
networkx                  2.6.3                    pypi_0    pypi
ninja                     1.10.2           py37hd09550d_3    defaults
numpy                     1.21.2           py37h20f2e39_0    defaults
numpy-base                1.21.2           py37h79a1101_0    defaults
oauthlib                  3.2.0                    pypi_0    pypi
onnx                      1.7.0                    pypi_0    pypi
onnxruntime               1.11.0                   pypi_0    pypi
opencv-python             4.5.5.64                 pypi_0    pypi
openh264                  2.1.1                h4ff587b_0    defaults
openmim                   0.1.5                    pypi_0    pypi
openssl                   1.0.2u               h7b6447c_0    defaults
ordered-set               4.1.0                    pypi_0    pypi
packaging                 21.3               pyhd3eb1b0_0    defaults
pandas                    1.1.5                    pypi_0    pypi
panopticapi               0.1                      pypi_0    pypi
pillow                    9.0.1            py37h22f2fdc_0    defaults
pip                       22.0.4                   pypi_0    pypi
pluggy                    1.0.0            py37h06a4308_1    defaults
prefetch-generator        1.0.1                    pypi_0    pypi
pretrainedmodels          0.7.4                    pypi_0    pypi
protobuf                  3.20.0                   pypi_0    pypi
py                        1.11.0             pyhd3eb1b0_0    defaults
py-cpuinfo                8.0.0                    pypi_0    pypi
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pycocotools               2.0.2                    pypi_0    pypi
pycodestyle               2.8.0              pyhd3eb1b0_0    defaults
pycparser                 2.21               pyhd3eb1b0_0    defaults
pyflakes                  2.4.0              pyhd3eb1b0_0    defaults
pygments                  2.11.2             pyhd3eb1b0_0    defaults
pyopenssl                 22.0.0             pyhd3eb1b0_0    defaults
pyparsing                 3.0.7                    pypi_0    pypi
pyqt5                     5.15.6                   pypi_0    pypi
pyqt5-qt5                 5.15.2                   pypi_0    pypi
pyqt5-sip                 12.10.1                  pypi_0    pypi
pyquaternion              0.9.9                    pypi_0    pypi
pysocks                   1.7.1                    py37_1    defaults
pytest                    6.2.5            py37h06a4308_2    defaults
pytest-benchmark          3.4.1                    pypi_0    pypi
python                    3.7.0                h6e4f718_3    https://repo.anaconda.com/pkgs/main
python-dateutil           2.8.2                    pypi_0    pypi
pytorch                   1.9.1           py3.7_cuda10.2_cudnn7.6.5_0    pytorch
pytorch-ignite            0.1.2                    pypi_0    pypi
pytorch-metric-learning   1.3.0                    pypi_0    pypi
pytz                      2022.1                   pypi_0    pypi
pywavelets                1.3.0                    pypi_0    pypi
pyyaml                    5.4.1                    pypi_0    pypi
qudida                    0.0.4                    pypi_0    pypi
readline                  7.0                  h7b6447c_5    https://repo.anaconda.com/pkgs/main
requests                  2.27.1             pyhd3eb1b0_0    defaults
requests-oauthlib         1.3.1                    pypi_0    pypi
rich                      10.16.2            pyhd3eb1b0_0    defaults
rsa                       4.8                      pypi_0    pypi
scikit-image              0.19.2                   pypi_0    pypi
scikit-learn              1.0.2                    pypi_0    pypi
scipy                     1.7.3                    pypi_0    pypi
seaborn                   0.11.2                   pypi_0    pypi
setuptools                58.0.4           py37h06a4308_0    https://repo.anaconda.com/pkgs/main
setuptools-scm            6.4.2                    pypi_0    pypi
six                       1.16.0             pyhd3eb1b0_1    defaults
sklearn                   0.0                      pypi_0    pypi
soupsieve                 2.3.2.post1              pypi_0    pypi
sqlite                    3.33.0               h62c20be_0    https://repo.anaconda.com/pkgs/main
tabulate                  0.8.9                    pypi_0    pypi
tensorboard               2.8.0                    pypi_0    pypi
tensorboard-data-server   0.6.1                    pypi_0    pypi
tensorboard-plugin-wit    1.8.1                    pypi_0    pypi
terminaltables            3.1.10                   pypi_0    pypi
threadpoolctl             3.1.0                    pypi_0    pypi
tifffile                  2021.11.2                pypi_0    pypi
timm                      0.5.4                    pypi_0    pypi
tk                        8.6.11               h1ccaba5_0    https://repo.anaconda.com/pkgs/main
toml                      0.10.2             pyhd3eb1b0_0    defaults
tomli                     2.0.1                    pypi_0    pypi
torchaudio                0.9.1                      py37    pytorch
torchvision               0.10.1               py37_cu102    pytorch
tqdm                      4.63.1                   pypi_0    pypi
typing                    3.7.4.3                  pypi_0    pypi
typing_extensions         4.1.1              pyh06a4308_0    defaults
ubelt                     1.0.1                    pypi_0    pypi
urllib3                   1.26.9                   pypi_0    pypi
werkzeug                  2.1.1                    pypi_0    pypi
wheel                     0.37.1             pyhd3eb1b0_0    https://repo.anaconda.com/pkgs/main
wrapt                     1.14.1                   pypi_0    pypi
xdoctest                  1.0.0                    pypi_0    pypi
xmltodict                 0.12.0                   pypi_0    pypi
xz                        5.2.5                h7b6447c_0    https://repo.anaconda.com/pkgs/main
yacs                      0.1.8                    pypi_0    pypi
yapf                      0.32.0                   pypi_0    pypi
zipp                      3.7.0              pyhd3eb1b0_0    defaults
zlib                      1.2.11               h7f8727e_4    https://repo.anaconda.com/pkgs/main
zstd                      1.4.9                haebb681_0    defaults

想请教下这是什么原因引起的?以及怎么才能将BNNeck与focal loss很好的结合在一起?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant