728x90
- EasyDict : dictionary의 value를 속성처럼 재귀적으로 접근 가능
https://chaeso-coding.tistory.com/100
yaml 파일 다루기, 읽기, key value 값 뽑기
yaml : 설정 파일 1. yaml 라이브러리 설치 pip install pyyaml 2. yaml 파일 읽기 import yaml config = yaml.load(open('yaml 파일 경로', 'r'), Loader = yaml.Loader) print(config) 3. yaml 파일의 키값 읽기 print(config.keys()) keys 하
chaeso-coding.tistory.com
이전에 포스팅했던 config dictionary를 활용해서 해볼거임
1. easydict 불러오기
from easydict import EasyDict
2. EasyDict 라이브러리로 속성을 불러올 수 있음
먼저, dictionary를 만든다.
easy = EasyDict(config)
easy
easy안의 특정 key값 접근하기
easy.'Key Name'
특정 key값 안의 특정 value 접근하기
easy.'Key Name'.'Value Name'
728x90
'STUDY > 인공지능' 카테고리의 다른 글
Diffusion model (1) (0) | 2023.04.18 |
---|---|
tensor 이미지 저장하는 법 (0) | 2023.04.10 |
yaml 파일 다루기, 읽기, key value 값 뽑기 (0) | 2023.03.29 |
np.array, ToTensor, ToPILImage 공부 (0) | 2023.03.28 |
Attention mechanism (0) | 2023.03.27 |