강의

멘토링

커뮤니티

Inflearn Community Q&A

babelai's profile image
babelai

asked

[For Beginners] Machine Learning with Kaggle • Deep Learning Analysis

LSTM model

[해결] LSTM모형 케라스 recurrent 모듈 도입 에러 수정

Resolved

Written on

·

854

2

from keras.layers.recurrent import LSTM

로 작성할 경우 ModuleNotFoundError: No module named 'keras.layers.recurrent' 라는 오류가 뜹니다. 이것은 최근 버전의 Keras (Keras 2.4.0 이상)에서는 recurrent 모듈이 폐기되었기 때문입니다.

대신에, keras.layers에서 직접 LSTM 레이어를 가져올 수 있습니다. 다음은 수정된 코드입니다.

from keras.models import Sequential

from keras.layers import LSTM, Dense

lstm = Sequential()

lstm.add(LSTM(units=6, activation='relu', input_shape=(1,1)))

lstm.add(Dense(units=1, activation='linear'))

 

머신러닝딥러닝kagglekerasrecurrent

Answer

This question is waiting for answers
Be the first to answer!
babelai's profile image
babelai

asked

Ask a question