AttributeError: cannot assign module before Module.__init__() call

2024. 2. 28. 18:06·Error Note
728x90
반응형

- 에러 문구  

AttributeError: cannot assign module before Module.__init__() call

 

신경망 모델 설계시 super().__init__()을 빼먹어 생기는 문제입니다.

 

아래 처럼 코드에 추가해주면 해결 가능합니다.

class Block(nn.Module):
    def __init__(self, in_channel, hidden_channel, out_channel):
        super(CBlock, self).__init__()
        
        .
        .
        .
728x90
반응형
저작자표시 (새창열림)

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

[dlib] dlib 설치시 에러  (1) 2024.05.10
TypeError: Unable to convert function return value to a Python type! The signature was () -> handle  (1) 2024.04.02
RuntimeError: Unable to find a valid cuDNN algorithm to run convolution  (1) 2023.11.19
TypeError: only integer scalar arrays can be converted to a scalar index  (1) 2023.11.07
runtimeerror: found dtype long but expected float  (2) 2023.09.26
'Error Note' 카테고리의 다른 글
  • [dlib] dlib 설치시 에러
  • TypeError: Unable to convert function return value to a Python type! The signature was () -> handle
  • RuntimeError: Unable to find a valid cuDNN algorithm to run convolution
  • TypeError: only integer scalar arrays can be converted to a scalar index
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)
  • 블로그 메뉴

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

  • 공지사항

  • 인기 글

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
ga.0_0.ga
AttributeError: cannot assign module before Module.__init__() call
상단으로

티스토리툴바