keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.86k stars 19.44k forks source link

LSTM is responding slow #9350

Closed mazharaliabro closed 3 years ago

mazharaliabro commented 6 years ago

I have been running LSTM keras default program using Sentiment corpus in jupyter notebook for 5 hours but not getting results. It show continue processing. There is no gup error recovered.

The details of my system are as under: Linux-x86_64 operating system, NVIDIA Driver Version: 384.111, GPUs: GeForce GTX 960M (GPU 0)s

I run example code of keras lstm first to know the process than I shall run this code on my own corpus

datafile: data = pd.read_csv('/home/mazhar/Downloads/Sentiment.csv')

Keeping only the neccessary columns

data = data[['text','sentiment']]

Model:

embed_dim = 128 lstm_out = 196

model = Sequential() model.add(Embedding(max_fatures, embed_dim,input_length = X.shape[1], dropout=0.2)) model.add(LSTM(lstm_out, dropout_U=0.2, dropout_W=0.2)) model.add(Dense(2,activation='softmax')) model.compile(loss = 'categorical_crossentropy', optimizer='adam',metrics = ['accuracy']) print(model.summary())

Please help and guide me to resolve my problem

xiping-fu commented 6 years ago

My experience is that replacing LSTM with CuDNNLSTM will speed 10+ times.