GlassyWing / bi-lstm-crf

使用keras实现的基于Bi-LSTM + CRF的中文分词+词性标注
Apache License 2.0
373 stars 84 forks source link

您好,问下如果想使用多个GPU卡,代码应该改什么地方呢? #14

Closed YYGe01 closed 4 years ago

YYGe01 commented 4 years ago

我尝试这行代码改成:os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3,4,5,6,7" 但是发现虽然GPU都用上了,但是迭代速度没有变化,不清楚应该怎么改,谢谢!

GlassyWing commented 4 years ago

可以将num_gpu设置为大于0 https://github.com/GlassyWing/bi-lstm-crf/blob/ed72b6be0068052a5a0fb117fa3c778cf2b671f3/dl_segmenter/core.py#L30