Sierkinhane / CRNN_Chinese_Characters_Rec

(CRNN) Chinese Characters Recognition.
1.82k stars 538 forks source link

RuntimeError:Tensor for argument #2 'targets' is on CPU,but expected it to be on GPU(while checking arguments for ctc_loss_gpu) #114

Closed freedommaomao closed 4 years ago

freedommaomao commented 5 years ago

当我用TextRecognitionDataGenerator工具创建英文的数据集 单词与单词之间有空格,调用python crnn_main.py开始训练就会报如下错误: RuntimeError:Tensor for argument #2 'targets' is on CPU,but expected it to be on GPU(while checking arguments for ctc_loss_gpu), 当我的训练数据集和图片中不包含空格时可以正常运行训练, 但是英文单词间的空格又是必须要识别的,请问这个问题如何解决?如何才能使训练结果模型能识别英文单词间的空格? 有谁能帮忙解答训练英文单词间空格的方法吗,万分感谢。@Sierkinhane @haneSier 我的训练环境如下: 系统:RHEL7 软件:python3.6 pytorch1.1 cudatoolkit10.0.130 cudnn7.3.1 cuda10.0

DeepInSearch commented 5 years ago

I met this error also, but it's on arabic line text which contain whitespace. But I don't try the word image which not have whitespace.

ghost commented 5 years ago

我也遇到了同样的问题 image

AemaH commented 5 years ago

您好,请问最后您是怎么解决这个问题的呢?

liyunfei1994 commented 5 years ago

您好!我也遇到了类似的这种问题。
RuntimeError: Tensor for argument #2 'weight' is on CPU, but expected it to be on GPU (while checking arguments for cudnn_batch_norm)
请问您有解决方法了吗?

zhangdaxia1 commented 4 years ago

请问大家有已经解决这个问题的么