ValueError: (InvalidArgument) shape should have the save dim with perm, but received shape size is:4, perm size is:3. #13873
Unanswered
letienan1998
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm training a new language with model SAR and stuck in predict_rec.py
I run command:
python3 tools/infer/predict_rec.py --image_dir="./predict/0.jpg" --rec_model_dir="./inference/rec/sar" --rec_image_shape="3, 100, 100,320" --rec_char_dict_path="./ppocr/utils/vi_dict.txt"
it show me:
[2024/09/15 21:37:28] ppocr WARNING: The first GPU is used for inference by default, GPU ID: 0
[2024/09/15 21:37:35] 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
Backend GTK4Agg is interactive backend. Turning interactive mode on.
[2024/09/15 21:37:46] ppocr INFO: Traceback (most recent call last):
File "/home/workspace/PaddleOCR/tools/infer/predict_rec.py", line 860, in main
rec_res, _ = text_recognizer(img_list)
File "/home/workspace/PaddleOCR/tools/infer/predict_rec.py", line 706, in call
self.predictor.run()
ValueError: (InvalidArgument) shape should have the save dim with perm, but received shape size is:4, perm size is:3.
[Hint: Expected shape.size() == perm.size(), but received shape.size():4 != perm.size():3.] (at /paddle/paddle/phi/kernels/funcs/transpose_function.cu.h:663)
[operator < transpose2 > error]
[2024/09/15 21:37:46] ppocr INFO: (InvalidArgument) shape should have the save dim with perm, but received shape size is:4, perm size is:3.
[Hint: Expected shape.size() == perm.size(), but received shape.size():4 != perm.size():3.] (at /paddle/paddle/phi/kernels/funcs/transpose_function.cu.h:663)
[operator < transpose2 > error]
My enviroment
OS: ubuntu 22.04 python 3.10.12 paddleocr & paddlepaddle: 2.6.1 CPU: i5 12400F RAM: 32GB GPU: GTX 1060 6G
Beta Was this translation helpful? Give feedback.
All reactions