Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch_PP-OCRv4_rec_distill.yml 训练报错:ValueError: (InvalidArgument) The input of Op(Conv) should be a 4-D or 5-D Tensor. #11226

Open
shenchenfei opened this issue Nov 8, 2023 · 3 comments
Assignees
Labels

Comments

@shenchenfei
Copy link

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

  • 系统环境/System Environment:ubuntu
  • 版本号/Version:Paddle:
    paddle-bfloat 0.1.7
    paddle2onnx 1.0.9
    paddlepaddle 2.4.2
    paddlepaddle-gpu 2.4.2.post112
    PaddleOCR: 问题相关组件/Related components:
  • 运行指令/Command Code:python3 tools/train.py -c configs/rec/PP-OCRv4/ch_PP-OCRv4_rec_distill.yml
  • 完整报错/Complete Error Message:
    Traceback (most recent call last):
    File "tools/train.py", line 227, in
    main(config, device, logger, vdl_writer)
    File "tools/train.py", line 202, in main
    amp_dtype)
    File "/home/shenchenfei/OCR_sh/chm-text-recognition/tools/program.py", line 305, in train
    preds = model(images, data=batch[1:])
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in call
    return self.forward(*inputs, **kwargs)
    File "/home/shenchenfei/OCR_sh/chm-text-recognition/ppocr/modeling/architectures/distillation_model.py", line 59, in forward
    result_dict[model_name] = self.model_list[idx](x, data)
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in call
    return self.forward(*inputs, **kwargs)
    File "/home/shenchenfei/OCR_sh/chm-text-recognition/ppocr/modeling/architectures/base_model.py", line 100, in forward
    x = self.head(x, targets=data)
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in call
    return self.forward(*inputs, **kwargs)
    File "/home/shenchenfei/OCR_sh/chm-text-recognition/ppocr/modeling/heads/rec_multi_head.py", line 92, in forward
    ctc_encoder = self.ctc_encoder(x)
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in call
    return self.forward(*inputs, **kwargs)
    File "/home/shenchenfei/OCR_sh/chm-text-recognition/ppocr/modeling/necks/rnn.py", line 261, in forward
    x = self.encoder(x)
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in call
    return self.forward(*inputs, **kwargs)
    File "/home/shenchenfei/OCR_sh/chm-text-recognition/ppocr/modeling/necks/rnn.py", line 208, in forward
    z = self.conv1(z)
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in call
    return self.forward(*inputs, **kwargs)
    File "/home/shenchenfei/OCR_sh/chm-text-recognition/ppocr/modeling/backbones/rec_svtrnet.py", line 68, in forward
    out = self.conv(inputs)
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in call
    return self.forward(*inputs, **kwargs)
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/nn/layer/conv.py", line 724, in forward
    use_cudnn=self._use_cudnn,
    File "/home/shenchenfei/.local/lib/python3.6/site-packages/paddle/nn/functional/conv.py", line 151, in _conv_nd
    False,
    ValueError: (InvalidArgument) The input of Op(Conv) should be a 4-D or 5-D Tensor. But received: input's dimension is 3, input's shape is [110, 160, 256].
    [Hint: Expected in_dims.size() == 4 || in_dims.size() == 5 == true, but received in_dims.size() == 4 || in_dims.size() == 5:0 != true:1.] (at /paddle/paddle/phi/infermeta/binary.cc:470)
    我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no):

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

@lizhq
Copy link

lizhq commented Dec 5, 2023

[Hint: Expected in_dims.size() == 4 || in_dims.size() == 5 == true, but received in_dims.size() == 4 || in_dims.size() == 5:0 != true:1.] 遇到了同样的问题

@OeasyC
Copy link

OeasyC commented Oct 8, 2024

[Hint: Expected in_dims.size() == 4 || in_dims.size() == 5 == true, but received in_dims.size() == 4 || in_dims.size() == 5:0 != true:1.] 遇到了同样的问题

有解决吗,我训练和推理都没问题,导出一直报错。

Copy link
Contributor

github-actions bot commented Jan 7, 2025

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants