- pycahrm 의 Expression Evaluator 를 사용해서
- OmegaConf 타입의 dictionary 디버깅 시
TypeError: get_str() takes 2 positional arguments but 3 were given 에러 발생
이때는 당황하지 않고
OmegaConf 값을 일반 dict로 변환
디버깅 과정에서 OmegaConf 객체를 일반 딕셔너리로 변환하여 평가하면 문제를 피할 수 있습니다.
OmegaConf.to_container 함수를 사용해서 변환해서 보자!
from omegaconf import OmegaConf
cfg = OmegaConf.create({"model": {"type": "resnet"}})
cfg_dict = OmegaConf.to_container(cfg, resolve=True) # OmegaConf -> dict 변환
# 디버깅 시 cfg_dict 사용
print(cfg_dict["model"]["type"]) # "resnet"
'일단 리스트업 > 기타' 카테고리의 다른 글
git 에서 대용량 파일 다운, 즉 LFS 사용하기 (0) | 2024.12.06 |
---|