본문 바로가기

반응형

Data-science/deep learning

(87)
[error handling] python generator, fit_generator를 썼을 때 loss가 변하지 않고 학습이 되지 않을 때, 시계열 데이터 학습 실수 제너레이터 구현과 상관없이 시계열 데이터의 학습 방법을 잘 몰라서 발생한 실수였다. 윈도우 사이즈가 10인경우 t ~ t+10, t+1 ~ t+11, t+2 ~ t+12 ... 이런식으로 데이터가 구성되고 가령, t ~ t+10, t+2 ~ t+12, t+5 ~ t+15, ... t+1 ~ t+11, t+3 ~ t+13, t+4 ~ t+14, ... 이런식으로 구성된다. 그런데 내가 구성한 방식은... 이런 시계열 순서를 무시하고 train/test를 먼저 분리한 후 t~t+10, t+1~t+11 ... 은 train으로 t+20~t+30, t+21~t+31 ... 은 test로 해서 겹치는 데이터가 없어진다. 즉 1초대 부터 10초대까지의 데이터는 3초대부터 13초대까지의 데이터와 겹치게 마련이고 그게..
[논문 읽기] EfficientDet: Scalable and Efficient Object Detection Challenge 1: efficient multi-scale feature fusion Challenge 2: model scaling 3.2. Cross-Scale Connections 3.3. Weighted Feature Fusion Unbounded fusion: However, since the scalar weight is unbounded, it could potentially cause training instability. Softmax-based fusion: the extra softmax leads to significant slowdown on GPU hardware. Fast normalized fusion: this fast fusion approach has very sim..
[torch] RuntimeError("{} is a zip archive 에러 해결 방법 에러 RuntimeError("{} is a zip archive (did you mean to use torch.jit.load()?)".format(f.name)) when loading model weights 문제 원인 : 학습은 torch 1.6 이상으로 하고 인퍼런스는 torch 1.6 버전 이하로 할 경우 위와 같은 에러가 발생한다. 해결 방법 : 학습시 모델을 저장할 때 다음과 같은 옵션을 추가하여 저장해준다. torch.save(model.state_dict(), path, _use_new_zipfile_serialization=False)
배경 차이가 뚜렷한 이미지에서, cv2.connectedComponetsWithStats 활용하여 객체 분리하고 자르기 + efficientDet image = cv2.imread('C:\\Users\\SGSDEV\\detection\\original\\6666.jpeg') img = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) _, src = cv2.threshold(img, 200, 255, cv2.THRESH_BINARY_INV) cnt, labels, stats, centroids = cv2.connectedComponentsWithStats(src) dst = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR) imgs = [] for i in range(1, cnt): # 각각의 객체 정보에 들어가기 위해 반복문. 범위를 1부터 시작한 이유는 배경을 제외 (x, y, w, h, area) = s..
efficientDet을 이용한 detection, deeplearning 저번에 문제를 해결하고, 학습을 하니 위 그림과 같이 제대로 학습이 된 걸 확인할 수 있었다. 사용한 코드는 https://github.com/wangermeng2021/EfficientDet-tensorflow2 GitHub - wangermeng2021/EfficientDet-tensorflow2: A Tensorflow2.x implementation of EfficientDet A Tensorflow2.x implementation of EfficientDet. Contribute to wangermeng2021/EfficientDet-tensorflow2 development by creating an account on GitHub. github.com 잘 돌아간다. 여기서 d2를 이용했다. ..
[detection] 이미지 labeling이 이상하다 싶지만 정상일 때 해결방법. PIL Image rotated 회전시키는 녀석. (PIL image 쓸데 없이 고성능) 문제점. AP가 0.9점 대로 굉장히 높음에도 불구하고 테스트 셋에 대한 성능이 극악했다. 이유가 뭘까 고심해보았고, 학습 세트 레이블링이 잘못된 건 아닐까 하고 뜯어보았다. 1. PIL image open을 이용하여 이미지와 레이블을 읽어 보니 레이블링이 엉망이었다. PASCAL VOC 레이블링을 읽고 다음과 같이 DataFrame 형태로 저장해둔다. df = pd.DataFrame() for i, file in tqdm(enumerate(selcet_files)): tree = elemTree.parse(file) bbox = tree.find('object').find('bndbox') filename = tree.find('filename').text xmin = bbox.find('xmin')...
[딥러닝] Graph2Vec 4가지 특징 1. Unsupervised representation learning: - graph2vec learns graph embeddings in a completely unsupervised manner i.e., class labels of graphs are not required for learning their embeddings. This allows us to readily use graph2vec embeddings in a plethora of applications where labeled data is difficult to obtain. - 비지도 표현 학습. graph2vec은 완전히 비지도 방식으로 그래프 임베딩을 배운다. 즉, 그래프 임베딩에 해당하는 클래스 라벨이 요구되지 않는다..
[pytorch] torch.utils.data.DataLoader 이용시 파일 경로 출력 배경 efficientNet을 이용한 간단한 분류기 만들기 github.com/narumiruna/efficientnet-pytorch narumiruna/efficientnet-pytorch A PyTorch implementation of "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks". - narumiruna/efficientnet-pytorch github.com shutil 을 이용해서 파일을 분류하고 분류 결과대로 저장하고 싶었다. 그래서 파일명이 필요했다. 과정 from torchvision.datasets import ImageFolder 보통 Image data의 경우 ImageFolder를 쓴다. fr..

728x90
반응형