Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Python script hangs when running lstm on multiple cores

$
0
0

@pooja16 wrote:

I am trying to create different lstm models on different data using multiprocessing Pool.
The program hangs when it tries to create a lstm layer.

def create_model(neurons, X):
    model = Sequential() 
    model.add(LSTM(neurons, input_shape=(X.shape[1], X.shape[2]), return_sequences=False))
    model.add(Dense(1, kernel_initializer='uniform', activation='relu'))
    model.compile(loss='mean_squared_error', optimizer='adam', metrics=['mae', 'mse','accuracy'])
    return model

from pathos.multiprocessing import ProcessingPool
from itertools import repeat
pool = ProcessingPool(4)
neurons = [50, 100]
results = pool.map(create_model, neurons, repeat(X))

The script hangs at the lstm layer creation. Program works if I replace lstm by dense. What is wrong in the code?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles