You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python tools/infer/predict_rec.py --image_dir="C:\F\2dramajp\99.9.Keij.Senmon.Bengoshi.The.Moviejp/0_00_52_824__0_00_55_827_0000000000000000000000002.png" --rec_algorithm='SVTR' --rec_model_dir=C:\Users\Administrator\Desktop\4lansvtr\best_accuracy --rec_image_shape=3,48,320 --rec_char_dict_path=C:\F\japan_dict.txt --use_gpu=True
[2024/06/16 05:49:46] ppocr INFO: In PP-OCRv3, rec_image_shape parameter defaults to '3, 48, 320', if you are using recognition model with PP-OCRv2 or an older version, please set --rec_image_shape='3,32,320
[2024/06/16 05:49:51] ppocr INFO: Traceback (most recent call last):
File "tools/infer/predict_rec.py", line 723, in main
rec_res, _ = text_recognizer(img_list)
File "tools/infer/predict_rec.py", line 670, in call
self.predictor.run()
ValueError: In user code:
File "tools/export_model.py", line 293, in <module>
main()
File "tools/export_model.py", line 288, in main
export_single_model(
File "tools/export_model.py", line 199, in export_single_model
paddle.jit.save(model, save_path)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\jit.py", line 631, in wrapper
func(layer, path, input_spec, **configs)
File "C:\Program Files\Python38\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\base.py", line 51, in __impl__
return func(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\jit.py", line 860, in save
concrete_program = static_func.concrete_program_specify_input_spec(
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 527, in concrete_program_specify_input_spec
concrete_program, _ = self.get_concrete_program(
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 436, in get_concrete_program
concrete_program, partial_program_layer = self._program_cache[cache_key]
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 801, in __getitem__
self._caches[item_id] = self._build_once(item)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 785, in _build_once
concrete_program = ConcreteProgram.from_func_spec(
File "C:\Program Files\Python38\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\base.py", line 51, in __impl__
return func(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 733, in from_func_spec
outputs = static_func(*inputs)
File "C:\Users\ADMINI~1\AppData\Local\Temp\tmpssoi69s_.py", line 27, in forward
x = paddle.jit.dy2static.convert_ifelse(self.use_backbone, true_fn_1,
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 211, in convert_ifelse
out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 257, in _run_py_ifelse
return true_fn(*true_args) if pred else false_fn(*false_args)
File "C:\F\pycharm2020.2\PaddleOCR-2.7.5\ppocr\modeling\architectures\base_model.py", line 86, in forward
x = self.backbone(x)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\layers.py", line 930, in __call__
return self._dygraph_call_func(*inputs, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "C:\F\pycharm2020.2\PaddleOCR-2.7.5\ppocr\modeling\backbones\rec_svtrnet.py", line 572, in forward
x = self.forward_features(x)
File "C:\F\pycharm2020.2\PaddleOCR-2.7.5\ppocr\modeling\backbones\rec_svtrnet.py", line 551, in forward_features
x = x + self.pos_embed
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\layers\math_op_patch.py", line 342, in __impl__
current_block(self).append_op(
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\framework.py", line 3615, in append_op
op = Operator(
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\framework.py", line 2635, in __init__
for frame in traceback.extract_stack():
InvalidArgumentError: Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [1, 1248, 64] and the shape of Y = [1, 960, 64]. Received [1248] in X is not equal to [960] in Y at i:1.
[Hint: Expected x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1 == true, but received x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1:0 != true:1.] (at ..\paddle/phi/kernels/funcs/common_shape.h:84)
[operator < elementwise_add > error]
[2024/06/16 05:49:51] ppocr INFO: In user code:
File "tools/export_model.py", line 293, in <module>
main()
File "tools/export_model.py", line 288, in main
export_single_model(
File "tools/export_model.py", line 199, in export_single_model
paddle.jit.save(model, save_path)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\jit.py", line 631, in wrapper
func(layer, path, input_spec, **configs)
File "C:\Program Files\Python38\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\base.py", line 51, in __impl__
return func(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\jit.py", line 860, in save
concrete_program = static_func.concrete_program_specify_input_spec(
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 527, in concrete_program_specify_input_spec
concrete_program, _ = self.get_concrete_program(
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 436, in get_concrete_program
concrete_program, partial_program_layer = self._program_cache[cache_key]
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 801, in __getitem__
self._caches[item_id] = self._build_once(item)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 785, in _build_once
concrete_program = ConcreteProgram.from_func_spec(
File "C:\Program Files\Python38\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\base.py", line 51, in __impl__
return func(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\program_translator.py", line 733, in from_func_spec
outputs = static_func(*inputs)
File "C:\Users\ADMINI~1\AppData\Local\Temp\tmpssoi69s_.py", line 27, in forward
x = paddle.jit.dy2static.convert_ifelse(self.use_backbone, true_fn_1,
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 211, in convert_ifelse
out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\dygraph_to_static\convert_operators.py", line 257, in _run_py_ifelse
return true_fn(*true_args) if pred else false_fn(*false_args)
File "C:\F\pycharm2020.2\PaddleOCR-2.7.5\ppocr\modeling\architectures\base_model.py", line 86, in forward
x = self.backbone(x)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\layers.py", line 930, in __call__
return self._dygraph_call_func(*inputs, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\dygraph\layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "C:\F\pycharm2020.2\PaddleOCR-2.7.5\ppocr\modeling\backbones\rec_svtrnet.py", line 572, in forward
x = self.forward_features(x)
File "C:\F\pycharm2020.2\PaddleOCR-2.7.5\ppocr\modeling\backbones\rec_svtrnet.py", line 551, in forward_features
x = x + self.pos_embed
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\layers\math_op_patch.py", line 342, in __impl__
current_block(self).append_op(
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\framework.py", line 3615, in append_op
op = Operator(
File "C:\Program Files\Python38\lib\site-packages\paddle\fluid\framework.py", line 2635, in __init__
for frame in traceback.extract_stack():
InvalidArgumentError: Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [1, 1248, 64] and the shape of Y = [1, 960, 64]. Received [1248] in X is not equal to [960] in Y at i:1.
[Hint: Expected x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1 == true, but received x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1:0 != true:1.] (at ..\paddle/phi/kernels/funcs/common_shape.h:84)
[operator < elementwise_add > error]
This discussion was converted from issue #13078 on June 17, 2024 01:25.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
问题描述 / Problem Description
运行环境 / Runtime Environment
复现代码 / Reproduction Code
完整报错 / Complete Error Message
可能解决方案 / Possible solutions
附件 / Appendix
python tools/infer/predict_rec.py --image_dir="C:\F\2dramajp\99.9.Keij.Senmon.Bengoshi.The.Moviejp/0_00_52_824__0_00_55_827_0000000000000000000000002.png" --rec_algorithm='SVTR' --rec_model_dir=C:\Users\Administrator\Desktop\4lansvtr\best_accuracy --rec_image_shape=3,48,320 --rec_char_dict_path=C:\F\japan_dict.txt --use_gpu=True
[2024/06/16 05:49:46] ppocr INFO: In PP-OCRv3, rec_image_shape parameter defaults to '3, 48, 320', if you are using recognition model with PP-OCRv2 or an older version, please set --rec_image_shape='3,32,320
[2024/06/16 05:49:51] ppocr INFO: Traceback (most recent call last):
File "tools/infer/predict_rec.py", line 723, in main
rec_res, _ = text_recognizer(img_list)
File "tools/infer/predict_rec.py", line 670, in call
self.predictor.run()
ValueError: In user code:
[2024/06/16 05:49:51] ppocr INFO: In user code:
Beta Was this translation helpful? Give feedback.
All reactions