ByungKwanLee / Causal-Unsupervised-Segmentation

Official PyTorch Implementation code for realizing the technical part of Causal Unsupervised Semantic sEgmentation (CAUSE) to improve performance of unsupervised semantic segmentation. (Under Review)
8 stars 1 forks source link

Cannot reproduce Dinov2 result #10

Open haoqiwang opened 4 months ago

haoqiwang commented 4 months ago

Hi, thanks for the great work. I cannot reproduce the DINOv2+CAUSE-TR on cocostuff27. I get 35.1 mIoU instead of 45.3. Could you help? Thanks a lot!

Here is the log

test_tr.py --dataset cocostuff27 --ckpt checkpoint/dinov2_vit_base_14.pth --gpu 4,5,6,7
------------------Configurations------------------
NAME_TAG: CAUSE-TR
data_dir: data
dataset: cocostuff27
port: 12355
ckpt: checkpoint/dinov2_vit_base_14.pth
distributed: False
load_segment: True
load_cluster: True
train_resolution: 322
test_resolution: 322
batch_size: 16
num_workers: 22
gpu: 4,5,6,7
num_codebook: 2048
reduced_dim: 90
projection_dim: 2048
dim: 768
num_queries: 529
-------------------------------------------------
# of Parameters: 9.01(M)
[TEST] Acc (Linear): 80.0% | [mIoU]: 33.0, [mAP]: 55.1, [Acc]: 66.1, : 100%|████████████████| 136/136 [00:06<00:00, 22.23it/s]
[mIoU]: 35.1, [mAP]: 60.3, [Acc]: 69.4, : 100%|███████████████████████████| 136/136 [08:20<00:00,  3.68s/it]

and here is the script to reproduce the bug

#!/bin/bash
######################################
# [OPTION] DATASET

# cocostuff27
dataset="cocostuff27"

######################################
# [OPTION] STRUCTURE
structure="TR"
######################################

# DINOv2
ckpt="checkpoint/dinov2_vit_base_14.pth"

######################################

######################################
# GPU and PORT
train_gpu="4,5,6,7"

# Non-Changeable Variable
test_gpu="${train_gpu:0}"
port=$(($RANDOM%800+1200))
######################################

######################################
# [STEP1] MEDIATOR
python train_mediator.py --dataset $dataset --ckpt $ckpt --gpu $train_gpu --port $port
######################################

######################################
# [STEP2] CAUSE
python train_front_door_tr.py --dataset $dataset --ckpt $ckpt --gpu $train_gpu --port $port
python fine_tuning_tr.py --dataset $dataset --ckpt $ckpt --gpu $train_gpu --port $port
######################################

######################################
# TEST
python test_tr.py --dataset $dataset --ckpt $ckpt --gpu $test_gpu
######################################
ByungKwanLee commented 4 months ago

It may depend the epoch number. I think you should change the epoch number adaptively.

For example

epoch 1 front_door epoch 3 fine_tune

might be operated

ShunZuo-AI commented 5 days ago

HI,Excuse me, have you solved this problem? If so, congratulations. Can you tell me the solution