My computer hangs (freezes), when training a convolutional network

334 views
Skip to first unread message

tini jini

unread,
Jul 24, 2018, 2:15:05 AM7/24/18
to Discuss
Hello,
My computer hangs (freezes), when training a convolutional network with below architecture:
(Codes in Keras-CPU)

    model = models.Sequential()
    model
.add(layers.Conv2D(64,(3, 3), activation='relu', input_shape=(320,20,1), padding='same'))
    model
.add(layers.MaxPooling2D((2, 2)))
    model
.add(layers.Flatten())
    model
.add(layers.Dense(5*320)
 
Train on 15048 samples, validation on 1368 samples.
batch_size=16
 model.fit(train_x, train_y, batch_size=batch_size,
                    epochs
=epochs, verbose=2,
                    callbacks
=early_stopping,
                    validation_data
=(val_x, val_y))

 model
.evaluate(test_x, test_y)

And model summary:



What operation does make the computer to freeze? (What operation is hard to doing?)
How can I prevent my computer from hanging?
Thank you

Martin Wicke

unread,
Jul 24, 2018, 4:22:50 AM7/24/18
to tini....@gmail.com, Discuss
You last layer contains a 16x1600x102400 tensor, which is multiplied with a 16x102400 matrix. That is large, especially on CPU. I don't think your machine hangs, it's just busy.

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/7fddbd08-17b0-4776-9c23-bfd6fad3d806%40tensorflow.org.

sriram sampath

unread,
Jul 24, 2018, 5:44:20 AM7/24/18
to Discuss
Dense Layer has more parameters. Try replacing it with convolution layer instead of dense & Flatten. Convolution layer can do classification and it takes smaller parameters. 
Reply all
Reply to author
Forward
0 new messages