분류 전체보기 (60) 썸네일형 리스트형 any/all(), enumerate() any() : 하나라도 True라면 True 반환all() : 모두 True면 True 반환Sample Codeif any(cur[1] enumerate() : index와 원소를 동시에 접근하는 방법Sample Code>>> for entry in enumerate(['A', 'B', 'C']):... print(entry)...(0, 'A')(1, 'B')(2, 'C') startswith, endswith 문자열로 이루어진 리스트, 딕셔너리에서 특정 문자(열)가 시작 혹은 끝 위치에 위치하는지 확인 startswith - 시작 위치 endswith - 종료 위치 활용법 # 날짜 리스트 dates = [ '2020-01', '2020-02', '2021-01', '2021-02', '2022-01', '2022-02' ] # 2020년만 출력하는 반복문 for date in dates: if date.startswith('2020'): print(date) else: continue '2020'으로 시작하는 문자가 확인되면 출력하는 샘플코드 입니다. fit() vs fit_generator in keras Keras에서 학습 시 fit()과 fit_generator() 차이 fit() 전체 data set을 한번에 fit method를 통과 시킴 즉, 전체 data set을 메모리에 올릴 수 있어야 사용할 수 있음 fit_generator() generator를 통해 데이터를 load generator는 multiprocessing을 진행 할 시 데이터 중복을 방지 메모리에 한번에 올리지 못할 때 사용 NUMA node Error NUMA : Non-Uniformed Memory Access (불균일 기억장치 접근) 마주한 Error Message "successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero" 의미 하는 바 NUMA node 정보가 올바르지 않지만, 적어도 한 개의 NUMA node가 있으니 일단 되게끔 해보겠다. 해결 방안 1. node 확인 $ lspci | grep -i nvidia 더보기 #01:00.0 수정 필요 01:00.0 VGA compatible controller: NVIDIA Corporation GA102 [GeForc.. Hint : If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info. This isn't available when running in Eager mode. GPU Memory가 부족하다는 의미 해결 방안으로는 3가지 정도가 있다. 1. 데이터셋 크기 줄이기 2. 배치 사이즈 줄이기 3. 충분한 메모리 사용 주의 사항 ec2 서버를 사용할 경우 큰 인스턴스를 사용하면 되지만 요금 주의!! 파일명 일괄 변경 : 접두어 rename ... expression : 이 표현을 replacement : 이것으로 바꾸라 file : 이런 파일만 example 추가 rename "" "20231006-" *.* example 제거 rename 20231006- "" 20231006-* Maximum Sub Array 1. 전체 탐색 (Brute Force) 모든 경우의 수를 탐색하는 방법으로 시간 복잡도가 O(N ^ 2) 2. 카데인 알고리즘 (Kadane's Algorithm) 다이나믹 프로그래밍 방식을 적용한 알고리즘으로 시간복잡도는 O(N) CONNX 보호되어 있는 글입니다. 이전 1 2 3 4 5 ··· 8 다음 목록 더보기