terrifyzhao / bert-utils

一行代码使用BERT生成句向量,BERT做文本分类、文本相似度计算
Apache License 2.0
1.65k stars 425 forks source link

如何用GPU跑 #12

Open JiahangOK opened 5 years ago

JiahangOK commented 5 years ago

您好,我的笔记本电脑是GTX1070的,跑的时候报ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[4096,768] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc 应该是内存不够,这应该怎么办呀?

terrifyzhao commented 5 years ago

显存不够,batch_size改小一点

JustinAsdz commented 5 years ago

请问下 我跑的时候也用了CUDA_VISIBLE_DEVICES 指定gpu 程序可以运行 但是没有占用gpu