PaddleOCR2Pytorch icon indicating copy to clipboard operation
PaddleOCR2Pytorch copied to clipboard

这里面的pytorch模型如何使用bf16进行推理呢

Open LY000001 opened this issue 1 year ago • 0 comments

作者,你好!我使用./PaddleOCR2Pytorch/tools/infer/predict_rec.py 进行推理,我把模型和数据转换成bfloat16后报一下错误,Traceback (most recent call last): File "./PaddleOCR2Pytorch/tools/infer/predict_rec.py", line 169, in main(utility.parse_args()) File "./PaddleOCR2Pytorch/tools/infer/predict_rec.py", line 155, in main rec_res, predict_time = text_recognizer(img_list) File "./PaddleOCR2Pytorch/tools/infer/predict_rec.py", line 122, in call prob_out = self.net(inp) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "/root/PaddleOCR2Pytorch/pytorchocr/modeling/architectures/base_model.py", line 94, in forward x = self.backbone(x) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "/root/PaddleOCR2Pytorch/pytorchocr/modeling/backbones/rec_mv1_enhance.py", line 198, in forward y = self.conv1(inputs) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "/root/PaddleOCR2Pytorch/pytorchocr/modeling/backbones/rec_mv1_enhance.py", line 36, in forward y = self._conv(inputs) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/conv.py", line 460, in forward return self._conv_forward(input, self.weight, self.bias) File "/opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages/torch/nn/modules/conv.py", line 456, in _conv_forward return F.conv2d(input, weight, bias, self.stride, RuntimeError: could not create a primitive descriptor for a convolution forward propagation primitive

LY000001 avatar Jan 15 '24 07:01 LY000001