- Operating system: Testing has been performed on Ubuntu 20.04.
- Python == 3.9
- PyTorch == 1.12.0
The checkpoint and loss logs for the DINO pre-trained model are located here.
1.Prepare a CSV with a column named 'file_path' that includes the absolute paths of all images, and modify the following section accordingly
ThyroidCytologySSL/dino/main_dino.py
Line 134 in 1da607a
aimed_df = pd.read_csv("/home/abe/kuma-ssl/data/all_df.csv")
- training
cd dino
python -m torch.distributed.launch --nproc_per_node=2 main_dino.py --arch vit_small --batch_size_per_gpu 256
If you experience NaN values in the DINO loss, please set fp_16
to False
, and also reduce the value of the gradient clipping.
1.Prepare a CSV with a column named 'file_path' that includes the absolute paths of all images, and modify the following section accordingly
ThyroidCytologySSL/mae/main_pretrain.py
Line 109 in f1721e6
aimed_df = pd.read_csv("/home/abe/kuma-ssl/data/all_df.csv")
- training
cd mae
python -m torch.distributed.launch --nproc_per_node=2 main_pretrain.py --arch vit_small --batch_size_per_gpu 256
dino/get_embed_imnet.py
dino/get_embed.py --pretrained_weights [dino_vits_chechpoint.pth]
dino/visualize_attention.py --pretrained_weights [dino_vits_chechpoint.pth] --image_path [image path]
100% labels
python dino/eval_line_all_8cls.py
10% or 1% labels 5seed
python dino/eval_line_few_8cls.py --rate [10 or 1]
100% labels
python dino/imnet_fine_10_8cls.py
10% or 1% labels 5seed
python dino/imnet_fine_few_8cls.py --rate [10 or 1]