OFA-Sys / Chinese-CLIP

Chinese version of CLIP which achieves Chinese cross-modal retrieval and representation generation.
MIT License
4k stars 418 forks source link

在finetune时报错KeyError: 'optimizer' #300

Open wrtppp opened 2 months ago

wrtppp commented 2 months ago

部分报错 ... 2024-04-18,21:54:45 | INFO | Rank 0 | valid_step_interval: 150 2024-04-18,21:54:45 | INFO | Rank 0 | vision_model: ViT-B-16 2024-04-18,21:54:45 | INFO | Rank 0 | warmup: 100 2024-04-18,21:54:45 | INFO | Rank 0 | wd: 0.001 2024-04-18,21:54:45 | INFO | Rank 0 | world_size: 1 2024-04-18,21:54:45 | INFO | Rank 0 | Use GPU: 0 for training 2024-04-18,21:54:45 | INFO | Rank 0 | => begin to load checkpoint '/home/ppop/Chinese-CLIP/datapath/pretrained_weights/clip_cn_vit-b-16.pt' 2024-04-18,21:54:46 | INFO | Rank 0 | train LMDB file contains 35000 images and 105000 pairs. 2024-04-18,21:54:46 | INFO | Rank 0 | val LMDB file contains 7500 images and 22500 pairs. Traceback (most recent call last): File "cn_clip/training/main.py", line 350, in main() File "cn_clip/training/main.py", line 231, in main optimizer.load_state_dict(checkpoint["optimizer"]) KeyError: 'optimizer' Exception in thread Thread-1: Traceback (most recent call last): File "/home/ppop/miniconda3/envs/torch/lib/python3.8/threading.py", line 932, in _bootstrap_inner

swrrrrrrr commented 2 months ago

你好,请问这个问题解决了吗?怎么解决的?