본문 바로가기

전체 글120

[에러] ImportError: cannot import name 'SAVE_STATE_WARNING' from 'torch.optim.lr_scheduler' pip install torch==1.4.0 ImportError: cannot import name 'SAVE_STATE_WARNING' from 'torch.optim.lr_scheduler' Torch 1.4.0 이후 버전에서 SAVE_STATE_WARNING 모듈이 삭제되어 발생한 오류 pip install torch==1.4.0 2023. 5. 12.
[에러] packaging.version.InvalidVersion: Invalid version: '0.10.1,<0.11' packaging.version.InvalidVersion: Invalid version: '0.10.1, 2023. 5. 12.
[에러] ModuleNotFoundError: No module named 'transformers.tokenization_bert' ModuleNotFoundError: No module named 'transformers.tokenization_bert' from transformers.tokenization_bert import BasicTokenizer ModuleNotFoundError: No module named 'transformers.tokenization_bert' transformers version을 2.9에서 4.27로 upgrade하니 위와 같은 에러 발생. 구글링하니, 4.0 이상의 버전에서 발생한다고 하여 3.5로 install 후 해결 pip install transformers==3.5 https://stackoverflow.com/questions/74005930/loss-does-not-decreas.. 2023. 5. 12.
[에러] OSError: Can't load config for 'klue/bert-base' OSError: Can't load config for 'klue/bert-base'. Make sure that: - 'klue/bert-base' is a correct model identifier listed on 'https://huggingface.co/models' - or 'klue/bert-base' is the correct path to a directory containing a config.json file 아래 늘 실행하던 간단한 코드를 실행하는데, 에러가 발생했다. from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained("klue/bert-base") 혹시, transformers가 ver.. 2023. 5. 12.
[에러] AttributeError: module 'torch.distributed' has no attribute '_reduce_scatter_base' pip install torch==1.10 AttributeError: module 'torch.distributed' has no attribute '_reduce_scatter_base' python 파일을 실행하는데, 아래 부분에서 위의 에러가 났다. from transformers import ( MODEL_MAPPING, AutoConfig, AutoTokenizer, AutoModel, ) apex라는 패키지의 mapping.py에서 발생하는데, apex-0.1-py3.7.egg 파일 내에 있어서 쉽게 수정이 어려웠다. 구글링을 해보니, torch >=1.10 이어야 지원가능하다는 것 확인. https://github.com/hpcaitech/ColossalAI/issues/2673#issue.. 2023. 5. 12.
[INTRO] 프롬프트 러닝(Prompt Learning) 이란? "Prompt Learning" prompt learning이란 자연어처리 분야에서 최근 새롭게 등장한 분야로, ChatGPT의 등장과 함께 새로운 트렌드로 떠오르고 있습니다. 4월 2일자 기사에 따르면, 글로벌 교육 플랫폼 '유데미'에선 프롬프트 강의만 7667개에 달하고, 한글자막을 제공하는 콘텐츠에는 1000명씩 수강자가 이어지고 있다고 합니다. 그 외에도 프롬프트 전문 기업과 프롬프트 엔지니어라는 직종까지 생겨나고 있는데요. ✔ 'prompt'의 의미 프롬프트(prompt)라는 것은 언어모델에 전달하는 질문이나 요청을 사용자가 응답을 유도(prompt)한다는 의미에서 프롬프트(prompt)라고 합니다. 자연어 질문, 코드 스니펫, 명령어 등을 프롬프트로 사용할 수 있는데, 언어모델이 정확하게 태스.. 2023. 4. 24.
[Docker][NVIDIA] Failed to initialize NVML: Driver/library version mismatch 해결 서버 재부팅 하지않고, nvidia 프로시저 재시작으로 해결하는 방법 nvidia-smi docker에서 컨테이너를 --gpus all 옵션으로 실행하고자 하는데 아래 에러 발생 docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy' nvidia-container.. 2023. 4. 19.
[Python] 파이썬 파일, 경로 복사 shutil.copyfile, copy, copy2, copytree copyfile < copy < copy2 src dst 설명 shutil.copyfile 파일 파일, 폴더 shutil.copy 이전 버전 shutil.copy 파일 파일, 폴더 shutil.copy2 파일 파일, 폴더 shutil.copy + 메타정보까지 복사 shutil.copytree 폴더 폴더 폴더 통째로 복사 2023. 1. 19.
[논문리뷰] Fine-grained Post-training for Improving Retrieval-based Dialogue Systems. NAACL 2021 Fine-grained Post-training for Improving Retrieval-based Dialogue Systems [저자] Janghoon Han(Department of Computer Science and Engineering- Sogang University, LG AI Research), Taesuk Hong, Byoungjae Kim, Youngjoong Ko, and Jungyun Seo [게재] NAACL, 2021 June [pdf] [인용수] 26회인용 [요약] 대화 응답 선택 (Conversational Response Selection) 태스크의 대표 3가지 데이터셋(Ubuntu, Duoban, E-commerce)에서 아래 2가지를 적용한 'fine-grained .. 2023. 1. 18.
[Python] 파이썬 경로 제외한 파일명 반환 - os.path.basename(path) os.path.basename(path) : 상위 경로를 제외한 파일명만 반환 : "/"문자열 기준 split하여 가장 마지막 것을 반환한다고 생각하면 된다. (따라서, "/"로 끝나는 경우 빈값 반환) 1) path 가 폴더인 경우 : 폴더명 2) path 가 파일인 경우 : 파일명 import os path = "/d/workspace/dir1/dir2/dir3" print(f"[1] '{os.path.basename(path)}'") # [1] 'dir3' path = "/d/workspace/dir1/dir2" print(f"[2] '{os.path.basename(path)}'") # [2] 'dir2' path = "/d/workspace/dir1/dir2/" print(f"[3] '{os.p.. 2023. 1. 17.
[Python] 파이썬 파일 내 디렉토리 생성 - os.mkdir, os.makedirs 1. os.mkdir("file1") : 현재 위치의 경로에서 "file1" 생성 import os os.mkdir("file1") 2. os.makedirs("dir1/dir2/dir3/file1", exist_ok=True) - 지정한 경로 내 모든 (하위) 디렉토리 생성 - "exist_ok" : 모든 경로가 존재할 경우 에러 발생 FileExistError import os os.makedirs("dir1/dir2/dir3/file1", exist\_ok=True) 2023. 1. 17.
[Error][Git] error: src refspec master does not match any git add와 commit 후 push를 하려는데 아래와 같은 에러가 발생 error: src refspec master does not match any push하는 사용자가 누구인지 정의가 되지 않아서 발생한 오류로 확인 아래와 같이하여 해결됨 $ git config --global user.name hyen4110 $ git config --global user.email hyen4110@tistory.com $ git init $ git add . $ git commit -m "add faiss" $ git config --global user.name hyen4110 $ git config --global user.email hyen4110@tistory.com $ git push -u ori.. 2023. 1. 17.
[Error] A load persistent id instruction was encountered 딥러닝 모델 예측 파일 실행하는데 아래와 같은 에러가 발생 A load persistent id instruction was encountered but no persistent\_load function was specified. 살펴보니, .bin 파일을 pickle로 load해서 발생했음 (이전에 작성한 코드 줄을 지우지 않아서 발생) 지우고나서 정상적으로 작동함 확인 https://stackoverflow.com/questions/66337562/unpicklingerror-a-load-persistent-id-instruction-was-encountered-but-no-persis 2023. 1. 12.
[Faiss][Error] ERROR:in method 'IndexFlatCodes_add', argument 3 of type 'float const *' faiss index에 document embedding을 add를 하는 과정에서 아래와 같은 에러 발생 ERROR:in method 'IndexFlatCodes\_add', argument 3 of type 'float const \*' 구글링을 하니, faiss index 에 add 하는 embedding값은 float 64가 아니라 float32여야한다고 한다. 아래와 같이 변경하여 에러 해결 확인 embeddings = embeddings.astype(np.float32) 2023. 1. 11.
[NLP][RS] Response Selection 이란? (Retrieval-based dialogue system) Response Selection 이란? '대화' 라는 것을 무엇으로 정의할 것인가? 라고 했을 때 그 답변에 따라 여러가지 패러다임이 존재하지만, response selection는 현재 발화(utterance)에 대한 다음 발화(response)를 선택한다는 점에 초점을 두고 모델링을 한다고 할 수 있습니다. 논문에 나와있는 설명을 더하자면, "검색 기반 대화 시스템(Retrieval-based dialogue system)" 에서는 지난 대화 기록(history)이 주어졌을 때, 발화자의 발화(utterance)를 입력하여 가장 적당한 답변을 선택하는 대화 작업을 수행합니다. 이것이 "애드-혹 검색(ad-hoc retrieval)" 태스크로 분류된다면, "각각의 발화를 query로 취급하여 이 qu.. 2022. 12. 28.