stoplearning 썸네일형 리스트형 Initialize specific parameters of a NN with pre-trained ones and stop them from learning # pre-trained & target state dictfile_name = './saved_models/nuscenes_CVT_model1100/saved_chk_point_27.pt'pre_state_dict = torch.load(file_name, map_location=torch.device('cpu'))['model_state_dict']target_state_dict = model.state_dict()# copy from pre-trained to targetfor name, param in pre_state_dict.items(): if 'shallow' in name: if name.replace("module.", "") in target_state_dict: .. 더보기 이전 1 다음