[Tensorflow] Tensorflow Error: InvalidArgumentError: slice index 0 of dimension 0 out bounds.

2023. 1. 28. 22:55·Error Note
728x90
반응형
반응형

- 전체 에러 문구

InvalidArgumentError (see above for traceback): slice index 0 of dimension 0 out of bounds.

[[node replica_0_1/model_2/roi_pooling_conv_1/strided_slice_1 (defined at /home/ailab/gy/homework_2/keras-frcnn-master/keras_frcnn/RoiPoolingConv.py:63) = StridedSlice[Index=DT_INT32, T=DT_FLOAT, begin_mask=0, ellipsis_mask=0, end_mask=0, new_axis_mask=0, shrink_axis_mask=7, _device="/job:localhost/replica:0/task:0/device:GPU:0"](replica_0_1/lambda_4/Slice, replica_0_1/model_2/roi_pooling_conv_1/strided_slice_1/stack, replica_0_1/model_2/roi_pooling_conv_1/strided_slice_1/stack_1, loss_1/concatenate_4_loss/strided_slice_2/stack_2)]]

[[{{node replica_1_1/model_2/dense_class_6/Reshape_1/_4063}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:1", send_device_incarnation=1, tensor_name="edge_8784_replica_1_1/model_2/dense_class_6/Reshape_1", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

​

​

​

Faster R-CNN Tensorflow에서 multi gpu를 사용하여 학습을 시도할 때 발생했던 오류입니다.

전체 모델 중 RPN 부분과 Classifier부분은 사전 학습된 모델을 로드하여 사용하고 있는데, 이때 이 모델들까지 multi_gpu_model 함수로 변환해주면 발생하는 오류입니다.

​

​

​

- 해결 방법

model_rpn = multi_gpu_model(model_rpn, gpus=2)
model_classifier = multi_gpu_model(model_classifier, gpus=2)
model_all = multi_gpu_model(model_all, gpus=2)

위 코드에서 사전 학습된 모델을 로드하는 부분인 model_rpn과 model_classifier를 주석 처리 해주면 됩니다!

728x90
반응형
저작자표시

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

[Pytorch] RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn  (0) 2023.01.29
TypeError: Encoders require their input to be uniformly strings or numbers. Got ['int', 'str']  (0) 2023.01.29
[Pytorch] RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #  (0) 2023.01.29
[Pytorch] RuntimeError: DataLoader worker (pid(s) 19106, 19107, 19109, 19110) exited unexpectedly.  (0) 2023.01.28
[Tensorflow] Tensorflow와 CuDNN 버전 에러  (0) 2023.01.28
'Error Note' 카테고리의 다른 글
  • TypeError: Encoders require their input to be uniformly strings or numbers. Got ['int', 'str']
  • [Pytorch] RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #
  • [Pytorch] RuntimeError: DataLoader worker (pid(s) 19106, 19107, 19109, 19110) exited unexpectedly.
  • [Tensorflow] Tensorflow와 CuDNN 버전 에러
ga.0_0.ga
ga.0_0.ga
    반응형
    250x250
  • ga.0_0.ga
    ##뚝딱뚝딱 딥러닝##
    ga.0_0.ga
  • 전체
    오늘
    어제
    • 분류 전체보기 (181) N
      • Paper Review (51) N
        • 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) N
      • 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)
  • 블로그 메뉴

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

  • 공지사항

  • 인기 글

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
ga.0_0.ga
[Tensorflow] Tensorflow Error: InvalidArgumentError: slice index 0 of dimension 0 out bounds.
상단으로

티스토리툴바