Closed Onion-Skins closed 1 year ago
图像的宽度设置为32的倍数试试?
@LDOUBLEV 确实将宽度设为32的倍数就可以了! 这个配置文件中的宽度设定可以和图片的实际宽度不同吗?那么两者什么关系呢?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
在Ubuntu 20.04上安装的PaddleOCR和StyleText,并且运行例子没有问题。 但当运行我自己的一张图片(397x32)的时候就出现错误: Traceback (most recent call last): File "/home/rodger/PaddleOCR/StyleText/tools/synth_image.py", line 82, in
synth_image()
File "/home/rodger/PaddleOCR/StyleText/tools/synth_image.py", line 35, in synth_image
synth_result = image_synthesiser.synth_image(text_corpus, img, language)
File "/home/rodger/PaddleOCR/StyleText/engine/synthesisers.py", line 43, in synth_image
synth_result = self.predictor.predict(style_input, text_input_list)
File "/home/rodger/PaddleOCR/StyleText/engine/predictors.py", line 81, in predict
synth_result = self.predict_single_image(style_input, text_input)
File "/home/rodger/PaddleOCR/StyleText/engine/predictors.py", line 53, in predict_single_image
style_text_result = self.generator.forward(tensor_style_input,
File "/home/rodger/PaddleOCR/StyleText/arch/style_text_rec.py", line 59, in forward
bg_gen_output = self.bg_generator.forward(style_input)
File "/home/rodger/PaddleOCR/StyleText/arch/style_text_rec.py", line 220, in forward
decode_bg_output = self.decoder_bg(encode_bg_output["res_blocks"],
File "/home/rodger/venv/myocr/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 891, in call
outputs = self.forward(*inputs, **kwargs)
File "/home/rodger/PaddleOCR/StyleText/arch/decoder.py", line 247, in forward
paddle.concat(
File "/home/rodger/venv/myocr/lib/python3.8/site-packages/paddle/tensor/manipulation.py", line 124, in concat
return paddle.fluid.layers.concat(input=x, axis=axis, name=name)
File "/home/rodger/venv/myocr/lib/python3.8/site-packages/paddle/fluid/layers/tensor.py", line 306, in concat
return core.ops.concat(input, 'axis', axis)
ValueError: (InvalidArgument) The 3-th dimension of input[0] and input[1] is expected to be equal.But received input[0]'s shape = [1, 128, 16, 200], input[1]'s shape = [1, 128, 16, 199].
[operator < concat > error]
换另一张图片的时候也是出现类似错误,都是shape的最后一个数字差别为1。 请问这是什么原因引起的呢?是Config.yml中的配置问题吗? 我只是在样板配置上修改了图片尺寸而已。
多谢指教!