일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- pandas
- Numpy
- OpenCV
- error
- C++
- C#
- Visual Studio
- JSON
- VS Code
- Docker
- pytorch
- Linux
- C
- 기타 연주
- label
- 프로그래머스
- Selenium
- YOLO
- paramiko
- mysql
- ubuntu
- pip
- nvidia-smi
- 채보
- 오류
- Python
- SSH
- 컨테이너
- windows forms
- 핑거스타일
- Today
- Total
목록AI (35)
기계는 거짓말하지 않는다
PyTorch 모델 사용 시, 입력 텐서와 가중치 텐서의 데이터 유형이 서로 일치하지 않을 때 발생할 수 있는 오류이다.아래는 오류 내용들이다. RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensorRuntimeError: Input type (torch.cuda.HalfTensor) and weight type (torch.cuda.FloatTensor) should be the same ~ to() method를 이용해 같은 데이터 유형으로 만들어주면 된다...
Tensorflow 2.10 GPU 버전을 사용하였다. keras 모델 fit 함수에서 오류가 발생했다. 아래는 오류 내용이다. tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, tensorflow.python.framework.errors_impl.UnimplementedError: Graph execution error: ... Deterministic GPU implementation of unsorted segment reduction op not available. [[{{node gradient_tape/sparse_categorical_crossentropy/SparseSoftmaxCrossEntropyWithLog..
torch의 load를 이용하여 model weight를 불러올 때, module. model 등이 key 값에 더 붙어있거나, key 이름이 다른 경우 변경하여 가지고 올 수 있다. 단, model 구조는 같아야 한다. state_dict = checkpoint[state_key] new_state_dict = {} # load된 model의 key에 model. 이 붙어있을 경우 제거 for k, v in state_dict.items(): if "model." in k: name = k[6:] new_state_dict[name] = v print(new_state_dict.keys()) if len(new_state_dict.keys()) == 0: model.load_state_dict(stat..
Darknet make 시 darknet 실행 파일만 생성될 경우 Makefile 수정이 필요하다. 위와 같이 작성되어 있으므로 LIBSO=1 이 되어야 한다.
Labelme JSON data의 label 명이 잘못되었을 때 변경하고 싶은 경우 하위 디렉터리가 존재하거나 존재하지 않는다면 수정이 필요하다. import os import glob import datetime import time import json # 경로 변경 dir_root_path = "G:/data" # 수정된 데이터 저장 경로 dest_dir_path = "G:/data_label_modify" # 하위 디렉터리 sub_dir_name_list = ["dir_001", "dir_006"] # perosn -> person, carr -> car CHANGE_LABEL_TABLE = { "perosn" : "person", "carr" : "car" } read_count = 0 star..
Labelme JSON 데이터에 포함 된 label 이름 별 object 개수를 확인할 경우 하위 디렉터리가 존재하지 않는다면 수정이 필요하다. 하위 디렉터리가 존재할 경우 디렉터리 별로 결과를 출력하고 모두 확인이 완료되면 전체 결과를 출력한다. import os import glob import datetime import time import copy import json # 경로 변경 dir_root_path = "G:/data" # 하위 디렉터리가 존재할 경우 sub_dir_name_list = glob.glob(os.path.join(dir_root_path, "*")) total_name_dict = {} class_name_dict = {} read_count = 0 start_time =..
classid, x center, y center, width, height 형식의 YOLO label 텍스트 파일의 class 별 object 개수를 확인하는 경우 import os import glob import datetime import time import copy # YOLO dataset 구조 형식일 경우 dir_root_path = "D:/Datasets/yolo_split_dataset/labels/" sub_dir_name_list = ["train", "val"] name_dict = {} read_count = 0 start_time = time.time() for sub_dir_name in sub_dir_name_list: label_path_list = glob.glob(os..
classid, x center, y center, width, height 형식의 YOLO label 텍스트 파일의 특정 classid를 제외해야 하는 경우 import os import glob import datetime import time # YOLO dataset 구조 형식일 경우 dir_root_path = "D:/Datasets/yolo_split_dataset/labels/" sub_dir_name_list = ["train", "val"] # 제외할 classid skip_classid_list = ["2", "5", "9"] start_time = time.time() for sub_dir_name in sub_dir_name_list: label_path_list = glob.glo..