Error and Solve (49) 썸네일형 리스트형 [에러 해결] AttributeError: "load()" has been removed, use yaml .. / pip install ruamel.yaml==0.17.* AttributeError: "load()" has been removed, use yaml .. AttributeError load() has been removed, use yaml.load(...) code에서 config = yaml.load(open(config, 'r'), Loader=yaml.loader) 가 있는데 여기서 AttributeError가 났다 해결: pip install ruamel.yaml==0.17.* pip install ruamel.yaml==0.17.*pip install ruamel.yaml==0.17.* yaml 과 관련된 specific한 버전을 설치하면 된다 Referencehttps://github.com/debbiemarksla.. [PDF를 ppt 바꾸기] 이미지화해서 ppt에 올리기 1. pdf를 ppt로 바꾸기 pdf 내용에 몇 가지 첨가하거나 수정하고 싶을 때 사실 텍스트까지 읽어주면 좋지만 아직 오류가 많이 나서 이미지만 복사하고 이미지 복사한 슬라이드 위에 텍스트 박스나 도형을 올리는 방식으로 수정하기로 결정 2.pptx 패키지 활용 pdf를 넣어서 pptx (이미지만 올린 간단한 ppt)를 만드는 코드 설치해야할 패키지들 pip install pytesseract python-pptx pillowpip install pdf2image tqdm PyPDF2sudo apt updatesudo apt install poppler-utils pip install pytesseract python-pptx pillow pip install pdf2i.. [에러 해결] IndexError: Caught IndexError in DataLoader worker process 0. / batch 내에 빈 list가 있을 때 오류: IndexError: Caught IndexError in DataLoader worker process 0. IndexError: Caught IndexError in DataLoader worker process 0. trainloader를 사용할 때 위와 같은 오류가 발생했습니다. 원인 발견 : batch내에 빈 list가 있을 때 values = [] # 위와 같이 preprocess를 할 때 (dataset get_item 함수 등에서) collate 대상이 빈 tensor일 때 발생한다 values는 원래 필요했던 example의 속성이었는데 이제 안 쓰게 되면서 빈 리스트를 돌려주게 되었다필요했지만 이제 필요가 없으므로 지워주면된다. 아래는 고친 코드flags =.. [에러 해결] AttributeError: module 'umap' has no attribute 'UMAP' / import umap.umap_ 에러: AttributeError: module 'umap' has no attribute 'UMAP' umap을 설치했는데 import umapreducer = umap.UMAP(n_neighbors=15, min_dist=0.1, metric='cosine', random_state=42)embedding_2d = reducer.fit_transform(embeddings) import umap reducer = umap.UMAP(n_neighbors=15, min_dist=0.1, metric='cosine', random_state=42) embedding_2d = reducer.fit_transform(embeddings) 위와 같은 코드를 실행할 때 AttributeError: m.. [코드 정리] accelerator.save_state(path:str) 기본 사용법 1.accelerator.save_state(path:str) 기본 사용법 `accelerator.save_state()` 함수는 기본적으로 하나의 인자를 받습니다. 그 인자는 파일 경로 (string) 입니다. 이 인자는 모델, 옵티마이저, 스케줄러 등 훈련 상태를 저장할 위치를 지정하는 역할을 합니다.accelerator.save_state(path: str)accelerator.save_state(path: str) 파라미터:- `path`: 저장할 파일의 경로를 지정하는 문자열입니다. 이 경로는 디렉토리와 파일 이름을 포함할 수 있습니다. 예를 들어, `"checkpoints/epoch_10"`와 같이 경로를 지정할 수 있습니다.예시 1:accelerator.save_state("checkpoi.. 파이썬에서 사용자로부터 입력을 받아 정수 리스트 처리 / xn = list(map(int, input().split())) 파이썬에서 사용자로부터 입력을 받아 정수와 정수 리스트를 처리하는 코드 파이썬을 사용하다 보면, 사용자로부터 입력을 받아 처리해야 하는 경우가 자주 있습니다. 특히, 알고리즘 문제 풀이나 데이터 처리 과정에서 많이 사용되는데 이번 예제는 두 가지 입력을 처리하는 방법을 보여줍니다. n = int(input())xn = list(map(int, input().split()))print(n)print(xn) 1. 첫 번째 줄: `n = int(input()) 이 코드는 사용자가 입력한 문자열을 정수로 변환하여 변수 `n`에 저장합니다. 예를 들어, 사용자가 `5`를 입력하면 `n`은 `5`가 됩니다. - `input()` 함수는 사용자로부터 입력받은 문자열을 반환합니다. - `int()` 함.. [오류 해결] Could not establish connection to "SEVERNAME": The VS Code Server failed to start / Uninstall vscode server from host 오류: Could not establish connection to "SEVERNAME": The VS Code Server failed to start Could not establish connection to "servername": The VS Code Server failed to start Remote 서버에 접근하지 못하는 문제가 발생했다. 해결: uninstall established server ctrl + shift + p 1. Ctrl + Shift + P를 눌러 메뉴창을 띄운다 2. > 커서 옆에 'uninstall~'을 쳐서 "Remote-SSH: Uninstall VS Code Server from Host..."를 누른다 3. 접근이 안되는 서버명을 클.. [에러 해결] RuntimeError: NetCDF: HDF error / corrupted 이므로 다시 다운 받기 RuntimeError: NetCDF: HDF error 데이터가 깨졌다는 뜻다시 다운 받으면 해결 된다 [에러 해결] TypeError: 'type' object is not subscriptable / python version을 올리는게 제일 좋다 TypeError: 'type' object is not subscriptable locations: dict[str, float] = { "z": -1.38, 'anotherkey': .....locations: dict[str, float] = { "z": -1.38, 'anotherkey': ..... 위와 같은 dict[str, float]에서 Type object is not subscriptable 에러가 났다 찾아보니까 3.8버전의 파이썬까지는 위와 같은 type을 automatic하게 알아듣는 기능이 구현 안되어 있다고 한다. python 3.9 이상으로 upgrade 현재 python 3.8을 사용하고 있는데, 이문제를 해결하기 위한 가장 쉬운 방법은 env를 3.9이상으로 다.. [오류 해결] ValueError: numpy.dtype size changed, may indicate binary incompatibility. / pip install numpy==1.26.4 오류 해결: ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject Value error가 났다. numpy version 변경 본래 numpy version이 2.0.1 꽤 높았는데 pip install numpy==1.26.4 numpy version을 낮췄다. 그리고 쥬피터 노트북을 쓴다면 kernel을 .. 이전 1 2 3 4 5 다음