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

why does the focal loss show zero while training? #13

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

why does the focal loss show zero while training? #13

bmxbmx3 opened this issue May 11, 2022 · 0 comments
Labels
question Further information is requested

Comments

@bmxbmx3
Copy link

bmxbmx3 commented May 11, 2022

I run the command below to start training:

python LightMBN/main.py --config LightMBN/bag_of_tricks_config.yaml --pre_train LightMBN/lmbn_n_market.pth

and the bag_of_tricks_config.yaml I set shows below:

T: 3
act: relu
amsgrad: false
batchid: 16
batchimage: 4
batchtest: 32
beta1: 0.9
beta2: 0.999
bnneck: true
config: ''
cpu: false
cutout: false
dampening: 0
data_test: market1501
data_train: market1501
datadir: /data/bmx/data/market101
decay_type: step_40_70
drop_block: false
epochs: 120
epsilon: 1.0e-08
feat_inference: after
feats: 256
gamma: 0.1
h_ratio: 0.33
height: 384
if_labelsmooth: true
loss: 1*CrossEntropy+1*Triplet+1*Focal
lr: 0.00035
lr_decay: 60
margin: 0.3
model: ResNet50
momentum: 0.9
nGPU: 1
nThread: 4
nesterov: true
num_anchors: 1
num_classes: 702
optimizer: ADAM
parts: 2
pcb_different_lr: true
pool: avg
probability: 0.5
random_erasing: true
reset: false
sampler: true
test_every: 10
w_ratio: 1.0
warmup: linear
weight_decay: 0.0005
width: 128

but the focal loss shows zero,why?

[INFO] Epoch: 1	Learning rate: 3.50e-05   Time used: 0 m 8 s
[INFO] [1/120]	183/183	[CrossEntropy: 6.481748][Triplet: 1.384218][Focal: 0.000000][Total: 7.865965] Time used: 1 m 32 s
[INFO] Epoch: 2	Learning rate: 7.00e-05   Time used: 1 m 32 s
[INFO] [2/120]	183/183	[CrossEntropy: 5.620776][Triplet: 0.537527][Focal: 0.000000][Total: 6.158300] Time used: 2 m 53 s
[INFO] Epoch: 3	Learning rate: 1.05e-04   Time used: 2 m 53 s
[INFO] [3/120]	80/184	[CrossEntropy: 4.945305][Triplet: 0.331177][Focal: 0.000000][Total: 5.276482] Time used: 3 m 29 s

the conda environment I used shows below:

# 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
@fubel fubel added the question Further information is requested label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants