stanfordnlp / treelstm

Tree-structured Long Short-Term Memory networks (http://arxiv.org/abs/1503.00075)
GNU General Public License v2.0
875 stars 236 forks source link

The cpu usage very high when run the program. #5

Closed qianye0905 closed 8 years ago

qianye0905 commented 8 years ago

Hello, I want to use this model to predict the semantic relatedness of Chinese sentence pairs. I didn't change the model but just change the program to accept the Chinese word vector with 200dim and Chinese dependency tree, but when I run the "th relatedness/main.lua" the cpu usage at almost 1700% on a 24 core server. And the application running at a very low speed.

My machine has GPU, so I tried to change the model to work on GPU with just require('cutorch') require('cunn') move model on gpu with :cuda() change input and output data on gpu with :cuda()

but it always give errors, and I am new to torch. Could you please gives me any suggestions?

Thanks.

kaishengtai commented 8 years ago

For your first issue, try setting the environment var OMP_NUM_THREADS to 4:

export OMP_NUM_THREADS=4

What GPU-related errors are you seeing?

qianye0905 commented 8 years ago

The problem has been resolved, thanks.

LIBOTAO commented 8 years ago

f