简体   繁体   English

Keras model 训练时间太长

[英]Keras model taking too long to train

So I have the following model for sentiment analysis (using pre trained word embeddings):所以我有以下 model 用于情绪分析(使用预先训练的词嵌入):
在此处输入图像描述
And as visible, I have a pre trained embedding matrix and only about 500k trainable parameters.可见,我有一个预先训练好的嵌入矩阵,只有大约 500k 个可训练参数。 So why does it take a whole eternity to train this model?那么为什么训练这个 model 需要整个永恒? The batch size is 128 and number of epochs is 25. And the ETA for first epoch is about 10 minutes.批量大小为 128,epoch 数为 25。第一个 epoch 的 ETA 约为 10 分钟。 I haven't even completed that.我什至还没有完成。

Just to mention, I am not using CUDA or anything.顺便提一下,我没有使用 CUDA 或任何东西。 I don't think I have a GPU enabled Tensorflow.我认为我没有启用 GPU Tensorflow。 And I'm willing to do anything to increase the speed.我愿意做任何事情来提高速度。 And I have Tensorflow 2.1.0.我有 Tensorflow 2.1.0。

And here's the answer I am not using CUDA or anything .这是I am not using CUDA or anything的答案。 Training on CPU is much slower than on GPU. CPU 上的训练比 GPU 慢得多。 If you don't have high-performance enough video card, you can use several services such as Google Colab or Kaggle如果你没有足够高性能的显卡,你可以使用 Google Colab 或 Kaggle 等多种服务

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM