Missing key(s) in state_dict: "clip_model.vision_tower.vision_model.embeddings.position_ids".

2024. 12. 12. 10:44·Error Note
728x90
반응형

- 전체 에러문구 

Missing key(s) in state_dict: "clip_model.vision_tower.vision_model.embeddings.position_ids".

 

 

pretrain 모델을 load_state_dict를 사용하여 업로드 할 때 모델의 구조가 맞지 않아 발생하는 에러입니다.

 

 

- 해결방법 

load_state_dic 함수의 파라미터로 strict=False 를 추가해주면 됩니다.

model.load_state_dict(ckpt, strict=False)

 

이 파라미터를 추가해주면 모델을 불러올 떄 불러올 수 있는 값들만 유동적으로 불러올 수 있습니다.

 

 

 

 

 

 

 

 

 

728x90
반응형
저작자표시 (새창열림)

'Error Note' 카테고리의 다른 글

[OpenCV] error: (-215:Assertion failed) cn == CV_MAT_CN(dstType) && ddepth >= sdepth in function 'getLinearFilter'  (0) 2025.03.17
ValueError: assignment destination is read-only  (0) 2025.02.10
TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'  (0) 2024.11.29
ncclInvalidArgument: Invalid value for an argument.  (1) 2024.09.20
ValueError: Cannot load <class 'diffusers.models.controlnet.ControlNetModel'> from / because the following keys are missing: Please make sure to pass `low_cpu_mem_usage=False` and `device_map=None` if you want to randomly initialize those weights or else  (1) 2024.08.13
'Error Note' 카테고리의 다른 글
  • [OpenCV] error: (-215:Assertion failed) cn == CV_MAT_CN(dstType) && ddepth >= sdepth in function 'getLinearFilter'
  • ValueError: assignment destination is read-only
  • TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'
  • ncclInvalidArgument: Invalid value for an argument.
ga.0_0.ga
ga.0_0.ga
    반응형
    250x250
  • ga.0_0.ga
    ##뚝딱뚝딱 딥러닝##
    ga.0_0.ga
  • 전체
    오늘
    어제
    • 분류 전체보기 (195)
      • Paper Review (56)
        • Video Scene Graph Generation (6)
        • Image Scene Graph Generation (18)
        • Graph Model (5)
        • Key Information Extraction (4)
        • Fake Detection (2)
        • Text to Image (1)
        • Diffusion Personalization (4)
        • LLM & VLM (4)
        • etc (12)
      • AI Research (49)
        • Deep Learning (30)
        • Artificial Intelligence (15)
        • Data Analysis (4)
      • Pytorch (13)
      • ONNX (5)
      • OpenCV (7)
      • Error Note (35)
      • Linux (2)
      • Docker (3)
      • Etc (7)
      • My Study (16)
        • Algorithm (10)
        • Project (4)
        • Interview (2)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    dataset
    i3d
    활성화 함수
    forch.nn.functional
    나이브 베이즈 분류
    GCN
    torch.nn
    알고리즘
    RuntimeError
    pandas
    Activation Function
    정규화
    TypeError
    3dinput
    Inductive bias
    tensorflow
    JNI
    contiguous
    pytorch
    linear regression
    transformer
    permute
    fine tuning
    그래프신경망
    Logistic regression
    ONNX
    오차 역전파
    HRNet
    차원의 저주
    dataloader
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
ga.0_0.ga
Missing key(s) in state_dict: "clip_model.vision_tower.vision_model.embeddings.position_ids".
상단으로

티스토리툴바