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

2023. 6. 4. 21:14·Error Note
728x90
반응형

- 전체 에러 문구

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

 

마지막 batch를 돌 때 데이터가 하나 밖에 남지 않아 발생하는 에러였습니다.

 

 

- 해결 방법

데이터 갯수에 따라 마지막 batch에서 데이터가 하나만 남지 않도록 batch size를 적절히 조정해주어야 합니다.
728x90
반응형
저작자표시 (새창열림)

'Error Note' 카테고리의 다른 글

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (9969,) + inhomogeneous part.  (1) 2023.07.14
importerror: cannot import name 'builder' from 'google.protobuf.internal' (/opt/conda/lib/python3.10/site-packages/google/protobuf/internal/__init__.py)  (1) 2023.07.02
[OpenCV] ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory  (0) 2023.05.18
[OpenCV] ImportError: libGL.so.1: cannot open shared object file: No such file or directory  (0) 2023.05.18
[Colab] Colab에 ipynb 파일 import 하기  (0) 2023.03.09
'Error Note' 카테고리의 다른 글
  • ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (9969,) + inhomogeneous part.
  • importerror: cannot import name 'builder' from 'google.protobuf.internal' (/opt/conda/lib/python3.10/site-packages/google/protobuf/internal/__init__.py)
  • [OpenCV] ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
  • [OpenCV] ImportError: libGL.so.1: cannot open shared object file: No such file or directory
ga.0_0.ga
ga.0_0.ga
    반응형
    250x250
  • ga.0_0.ga
    ##뚝딱뚝딱 딥러닝##
    ga.0_0.ga
  • 전체
    오늘
    어제
    • 분류 전체보기 (181)
      • Paper Review (51)
        • Video Scene Graph Generation (6)
        • Image Scene Graph Generation (18)
        • Graph Model (5)
        • Key Information Extraction (4)
        • Fake Detection (2)
        • Text to Image (1)
        • Diffusion Personalization (4)
        • etc (11)
      • AI Research (49)
        • Deep Learning (30)
        • Artificial Intelligence (15)
        • Data Analysis (4)
      • Pytorch (10)
      • ONNX (5)
      • OpenCV (2)
      • Error Note (34)
      • Linux (2)
      • Docker (3)
      • Etc (7)
      • My Study (16)
        • Algorithm (10)
        • Project (4)
        • Interview (2)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    contiguous
    오차 역전파
    정규화
    pytorch
    Logistic regression
    dataloader
    torch.nn
    permute
    나이브 베이즈 분류
    차원의 저주
    GCN
    그래프신경망
    TypeError
    Activation Function
    JNI
    Inductive bias
    HRNet
    알고리즘
    ONNX
    활성화 함수
    tensorflow
    fine tuning
    RuntimeError
    linear regression
    forch.nn.functional
    3dinput
    transformer
    i3d
    dataset
    pandas
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
ga.0_0.ga
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 512, 1, 1])
상단으로

티스토리툴바