반응형

pytorch 2

[pytorch error] ValueError: Expected more than 1 value per channel when training, got input size torch.Size ...

안녕하세요 전자둥이 입니다. 학습을 진행 했을 때 분명 문제가 없던 모델이고 데이터셋만 바꿨을 뿐인데 해당 에러가 발생하는 것을 목격했습니다. ValueError: Expected more than 1 value per channel when training, got input size torch.Size ... 저의 경우 해당 에러가 발생한 이유가 (데이터셋의 개수 / batch_size) 를 했을 때 나머지가 1이 나오게 되면 저런 에러가 발생했습니다. ex) 사용한 데이터 개수가 13개 batch_size를 2 로 진행하게되면 위에서 언급한 에러가 발생하며 해당 에러를 발생 하지 않으려면 batch_size를 5를 주면 문제없이 학습이 진행됩니다. 이 글로 에러를 쉽게 해결하셨으면 좋겠습니다. 감사..

카테고리 없음 2022.08.12

Classification 성능 올리는 법

개발환경 OS: window10 프레임워크: Pytorch 모델:mobilenet_v2 다음과 같은 개발환경에서 직접 데이터를 모은 custom data 10가지 클래스를 가지고 성능 테스트 진행중에 있습니다. 이번 포스팅에서 말하고 싶은 내용은 data augmentation이 정말 중요하다는 내용입니다. teachablemachine.withgoogle.com/ Teachable Machine Train a computer to recognize your own images, sounds, & poses. A fast, easy way to create machine learning models for your sites, apps, and more – no expertise or coding req..

AI 2021.01.22
반응형