본문 바로가기

AI/Coding errors

(12)
E: Unable to locate package ~~~ Error 해결방법: [Linux] E: Unable to locate package yum (tistory.com) [Linux] E: Unable to locate package yum * 해당 글을 작성하기 위해 새로운 인스턴스를 생성하여 IP가 노출됩니다. 게시 완료 후 인스턴스는 종료 예정입니다! 새로운 인스턴스 환경에는 yum이 없다는 걸 알고 설치를 하니 해당 에러가 integer-ji.tistory.com Vim 사용방법: [Linux] vi(vim)에디터 사용방법 (tistory.com) [Linux] vi(vim)에디터 사용방법 리눅스를 이용한 개발 혹은 리눅스서버를 운영하는 개발자라면 반드시 알아야 하는 것중에 한가지가 바로 텍스트 에디터를 사용하는 방법입니다. 윈도우의 경우 메모장이..
RuntimeError: Cannot writeback when the parameter shape changes 해당 에러는 모델을 돌리는 도중, backpropagation을 진행할 때 모델의 파라미터 shape이 같아야하는데 다를 때 일어나는 것이다. 에러를 어떻게 해결할까!? 일단 위의 system file을 따라서 위의 함수로 들어간다! if src_tensor is not None and src_tensor.shape != expected_shape: # NOTE: Gradient shape mismatch is not possible in practice since # the gradient shape is enforced to match that of the parameter and # we already check for parameter shape mismatch. raise RuntimeError..
RuntimeError: no support for _allgather_base in Gloo process group 에러가 일어난 곳: https://github.com/mlfoundations/open_flamingo/tree/main/open_flamingo/train Openflamingo model을 gloo로 설정해서 돌리는데 해당 부분에서 에러가 일어났다. 검색을 해보니, _allgather_base함수가 nccl에서 작동되지 않는다고 한다... 어떻게 해결해야할까!? Method: [torch_list] 형태로 all_gather 이용하기 해당 문제를 풀기 위해서는 일단 _exec_order_utils.py라는 system file로 들어와야 한다. 그리고 해당 파일에서 밑의 코드와 같은 부분을 찾을 수 있다! world_num_valid_indices = torch.zeros(self.world_size..
AttributeError: 'GatedCrossAttentionBlock' object has no attribute 'clip_grad_norm_' 에러가 일어난 곳: https://github.com/mlfoundations/open_flamingo/tree/main/open_flamingo/train Openflamingo model을 nccl없이 gloo만 해서 훈련하고자 노력중인데 해당 에러를 만났다. 어떻게 해결해야할지 2시간을 헤매다가 해결방법을 찾았다! Method: torch framework의 clip_grad_norm_ 이용하기 Flamingo class이다. 해당 class에서 밑의 코드와 같은 부분을 찾을 수 있다! # set up clip_grad_norm_ function def clip_grad_norm_(max_norm): self.perceiver.clip_grad_norm_(max_norm) for layer in s..
RuntimeError: Invalid scalar type ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 30788) of binary DDP를 할려는데, gpu가 1개라서 FDSP로 실행시키고, gloo type으로 했는데 Model을 불러오는데 Invalid type error라는 에러가 자꾸 뜬다.. 어떻게 해결해야할까!? Method: 내부 로직 수정 C 드라이브 안으로 들어가서, 가상환경 안에 있는 내부 python code에서 버그가 일어난 곳이다. 여기 보면 nn.ModuleList에서 추가할 때 type이 이상하다는 걸 의미하는 것 같다. 그래서 wrap() function을 전부 지워주었다. 그랬더니 넘어가서 해결은 일단 되었는데, DDP 작동에 있어서 해결이 될지는 모르겠다... +) GPU memory 터져서 훈련도 잘되는지는 모르겠는데.. 나중에 랩실 서버로 돌려서 훈련되면 추가적으로 공유하겠습니다..ㅎㅎ 2023...
[Window] bitsandbytes download - PEFT using LoRA(QLoRA) 드디어... LLM을 PEFT 방식을 이용해서 훈련시킬려고 하는데, bitsandbytes가 linux만 지원한다는 얘기만 잔뜩 있고 도움이 되는 글들을 못 찾아서 디버깅하는데만 5시간 쏟은 것 같다... 요즘 LLM fine-tuning하면 LoRA와 QLoRA가 대세이고, 또 이것을 양자화해서 memory의 효율성을 가져가는게 트렌드인데 이 양자화를 해서 memory를 아낄려면 8-bit, 4-bit로 weight를 설정하고 float과 상호성을 띄도록 만들어줘야 하는데 여기 필요한 모듈 중 하나가 바로 bitsandbytes이다... 방법1) bitsandbytes-windows-webui github https://github.com/jllllll/bitsandbytes-windows-webui ..
ipykernel_launcher.py: error: unrecognized arguments: -f parser = config_parser() args = parser.parse_args() parser를 불러오는 과정에서 위와 같은 에러를 만났다. 도대체 무엇이 문제인가!? 해결방법: parse_args()에 '' 추가하기 parser = config_parser() args = parser.parse_args('') 위에 처럼 코드에 ''를 추가했을 뿐인데 에러가 없어졌다!? 신기하지만(?) 일단 에러가 없어졌으니 해결완료! 2023.06.02 Kyujinpy 작성.
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1024, 1024]], which is output 0 of AsStridedBackward0, is at version 2; expected version 1 instead. 에러코드 전체 ''' RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1024, 1024]], which is output 0 of AsStridedBackward0, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True) ''' 구현하고자 했던 git..
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead. (Smplx 실행 에러) 갑자기 .view() function에 에러가 있다고 발생했다. 이 문제를 어떻게 해결할까? # smplx/lbs.py # Error code (below) transforms_mat = transform_mat( rot_mats.view(-1, 3, 3), rel_joints.view(-1, 3, 1)).view(-1, joints.shape[1], 4, 4) 위의 코드 block에서 오류가 일어난 상황이다. # smplx/lbs.py # Change code (below) transforms_mat = transform_mat( rot_mats.view(-1, 3, 3), rel_joints.contiguous().view(-1, 3, 1)).view(-1, joints.shape[1], 4, 4) ..
[wget 설치] - FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다(2). (MPS-Net 실행 에러) FFMPEG를 깔아서 실행되나 싶었더니, 갑자기 또 해당 에러가 발생했다. 후.. 이번에는 무엇이 문제일까? 원인 찾기 - 일단 terminal error를 통해서 multi_person_traker에 있는 mpt.py를 들어가보자. - Terminal error를 보니 여기 있는 YOLOv3를 만들 때 문제가 있는 것 같다. - 그러면 terminal에 경로를 따라서, yolov3/yolo.py에 들어가보자. - Terminal에서 출력된 downloading url 링크를 찾아내었다. - 해당 function을 보니, cmd에서 wget이라는 것을 실행시킬려고 한다. - ffmpeg처럼 wget도 설치를 해줘야 할 것이라고 느낌이 들었다. wget 설치 https://eternallybored.org..
[ffmpeg 설치] - FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다(1). (MPS-Net 실행 에러) 아무리 살펴봐도 경로도 다 맞는데, 어디서 파일을 찾을 수 없는지 이해할 수 없었던 찰나, ffmpeg가 매우 거슬렸다. FFMPEG 설치 https://ffmpeg.org/download.html#build-windows Download FFmpeg If you find FFmpeg useful, you are welcome to contribute by donating. More downloading options Git Repositories Since FFmpeg is developed with Git, multiple repositories from developers and groups of developers are available. Release Verification All FFmpe ..
Python argparse action='store_true'의 의미 # NeRF code def config_parser(): import argparse parser = argparse.ArgumentParser() parser.add_argument("--render_only", action='store_true', help='do not optimize, reload weights and render out render_poses path') parser.add_argument("--render_test", action='store_true', help='render the test set instead of render_poses path') return parser 요즘 github에 보면 argparse를 이용해서 인자를 받고 training 시키는 형태는 수..

반응형