megvii-research / BBN

The official PyTorch implementation of paper BBN: Bilateral-Branch Network with Cumulative Learning for Long-Tailed Visual Recognition
https://arxiv.org/abs/1912.02413
MIT License
657 stars 100 forks source link

Accuracy on ImageNet-LT #17

Open pengzhiliang opened 3 years ago

pengzhiliang commented 3 years ago

Hello, thank u for the effective method and clean code! I try to change your code to run on ImageNet-LT, but get a not so good result. The config is as follow:

NAME: 'BBN.ImageNet.coslr.res50.90epoch'
OUTPUT_DIR: './output/bbn/ImageNet'
SHOW_STEP: 50
SAVE_STEP: 30
VALID_STEP: 1
INPUT_SIZE: (224, 224)
COLOR_SPACE: 'RGB'
CPU_MODE: False

DATASET:
  ROOT: 'Dataset/ILSVRC2012'
  DATASET: 'ImageNet'
  DATA_TYPE: 'JPEG'
  TRAIN_JSON: 'datasets/ImageNet_LT/ImageNet_LT_train.txt'
  VALID_JSON: 'datasets/ImageNet_LT/ImageNet_LT_val.txt'

BACKBONE:  
  TYPE: 'bbn_res50'

MODULE:
  TYPE: 'GAP'

LOSS:
  LOSS_TYPE: 'CrossEntropy'

CLASSIFIER:
  TYPE: 'FC'
  BIAS: True

TRAIN:
  BATCH_SIZE: 256
  MAX_EPOCH: 90
  NUM_WORKERS: 16
  COMBINER:
    TYPE: 'bbn_mix'
  TENSORBOARD:
    ENABLE: False
  SAMPLER:
    TYPE: 'default'
    DUAL_SAMPLER:
      ENABLE: True
      TYPE: 'reverse'
  OPTIMIZER:
    TYPE: 'SGD'
    BASE_LR: 0.1
    MOMENTUM: 0.9
    WEIGHT_DECAY: 5e-4
  LR_SCHEDULER:
     TYPE: 'cosine'
     COSINE_DECAY_END: 0
     WARM_EPOCH: 5

TRANSFORMS:
  TRAIN_TRANSFORMS: ("random_resized_crop", "random_horizontal_flip", "color_jitter")
  TEST_TRANSFORMS: ("shorter_resize_for_crop", "center_crop")

TEST:
  BATCH_SIZE: 128
  NUM_WORKERS: 16
  MODEL_FILE: '/home/BBN/models/BBN.ImageNet.res50.90epoch.best_model.pth'

But only get 46.26% on val set, the baseline is about 44% Have you run BBN on ImageNet and get some results? Can u tell me. Thank u very much! @ZhouBoyan

Vanint commented 3 years ago

I obtain similar results. Do you solve this problem?

pengzhiliang commented 3 years ago

No, I give it up

YoursEver commented 2 years ago

@pengzhiliang Excuse me. What is the GPU card you used? My master student tried to run this code for our fish image dataset, but she encountered the out-of-memory problem. (Resnet-50, 128*128, batchsize=8, on 1080Ti / 2080Ti)

woshiwby commented 2 years ago

@pengzhiliang Excuse me. What is the GPU card you used? My master student tried to run this code for our fish image dataset, but she encountered the out-of-memory problem. (Resnet-50, 128*128, batchsize=8, on 1080Ti / 2080Ti)

Excuse me, when I used our mushroom dataset, I encountered "NameError : name ' tun_latin' is not defined" problem. Could you tell me how to solve it?