SAM FINETUNE ERROR 상황 : SAM Finetune 후에 모델 형식이 .ckpt 형식으로 나오는데 테스트하기 위해서 .pth 변환이 필요하다. Finetune.ckpt to Finetune.pth 변환 ######### ckpt2pth.py ######### import torch def convert_checkpoint_to_state_dict(ckpt_path): """ Converts a PyTorch checkpoint file to a state dictionary (.pth) file. Args: - ckpt_path (str): Path to the checkpoint file. Returns: - state_dict (dict): The state dictionary extracted from the chec.. 이전 1 다음