티스토리 뷰
Computer Science/에러 기록 정리
[keras]UserWarning: The input 10 could not be retrieved. It could be because a worker has died. UserWarning)
JG Ahn 2019. 11. 7. 18:50environment
- Colab, hardware accelerator : GPU
- python : 3.6.8
- tensorflow : 1.13.1
Error
/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py:610: UserWarning: The input 10 could not be retrieved. It could be because a worker has died.
Situation
Google Colab에서 Efficientnet(Ref3) 모델을 학습하는 도중 위와 같은 log가 출력되었다.
Ref1에 따르면 별 문제가 없다고 하지만 1 Epoch이 끝난 다음 두 번째 Epoch이 절대 시작되지 않았다
계속 찾아본 결과 똑같은 상황을 겪고 있는 Ref2를 발견하였다
여기서 제시하는 문제점으로는 1. 멀티 프로세싱 모드 사용 2. 구글 드라이브 마운트 상태 가 있었다
그래서 use_multiprocessing=True와 workers=0 부분을 없애고 나니 학습이 매우 잘 된다.
Code
import datetime
import tensorflow as tf
from keras.applications import Xception
from keras.utils import multi_gpu_model
start = datetime.datetime.now()
num_classes = 2
with tf.device('/gpu:0'):
model = Xception(weights=None,
input_shape=(height, width, 3),
classes=num_classes)
model.compile(loss='categorical_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])
history = model.fit_generator(
train_generator,
steps_per_epoch= NUM_TRAIN //batch_size,
epochs=epochs,
validation_data=validation_generator,
validation_steps= NUM_TEST //batch_size,
verbose=1
use_multiprocessing=True,
workers=0)
end = datetime.datetime.now()
time_delta = end - start
Ref
- https://stackoverflow.com/questions/58446290/userwarning-an-input-could-not-be-retrieved-it-could-be-because-a-worker-has
- https://datascience.stackexchange.com/questions/60647/keras-userwarning-the-input-1303-could-not-be-retrieved-it-could-be-because-a
- https://github.com/Tony607/efficientnet_keras_transfer_learning
'Computer Science > 에러 기록 정리' 카테고리의 다른 글
Colab과 Google drive를 사용하면서 일어난 불편한 일들 (4) | 2020.06.28 |
---|---|
[AWS Lambda]errno 30 read-only file system (0) | 2019.11.13 |
[boto3]An error occurred (404) when calling the HeadObject operation (0) | 2019.11.13 |
[boto3]The AWS Access Key Id you provided does not exist in our records. (0) | 2019.11.12 |
[boto3]ImportError: No module named boto3 (0) | 2019.11.12 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 모델 시각화
- boto3
- 핵심어 검출
- tensorflow
- aws cli
- nlg
- MIT
- AWS
- 6.006
- 알고리즘 강의
- 시계열
- Introduction to Algorithm
- wavenet
- 오디오 전처리
- 알고리즘
- lambda
- keras
- BOJ
- Tensorflow2.0
- MFCC
- LSTM
- librosa
- nlp
- TF2.0
- netron
- stft
- RNN
- 인공지능 스피커 호출
- S3
- nlp 트렌드
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함