-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
PPOCRLabel开启时报错,打不开 #10748
Comments
从报错上面看(213,488,4)应该是图像的透明通道也被读取了,请确认是否修改了部分代码?尤其是图像读取的部分,输入的图像矩阵需要是三通道的,目前在最先版本代码中尚不能复现该问题。 |
我这边也会报这个错。 python版本 3.11, 代码 是2.7 release。 |
@chenhao86 @CarlWangMing 抱歉,在python版本 3.11, 代码 是2.7 release,windows环境 已经复现该问题。 原因如下: |
@Gmgge 专业啊。 |
感谢大佬 |
最新的2.7.0.3 的paddleocr.py 並沒有加入此修正,導致PPOCRLabel 啟動仍會有相同問題 |
牛逼 |
…透明色的需求,由于在check_img中以及存在对单通道图像转三通道图像的处理,因此将该四通道图像处理成三通道的图像也放入该check_img,并统一三通道图像输出逻辑。 (#10847) add:由于函数复杂度增高,增加注释。
同样问题,正确解决。 |
关于“ValueError: operands could not be broadcast together with shapes (213,488,4) (1,1,3)”的问题 |
通过这个方法解决了,非常感谢 |
我也解决了,但是后面自动标注完,点击确认OK,又闪退了,报错日志是: |
这是正解 另一个没用 |
用了這個解決了 前一個做法沒反應! |
2.7.1依然存在该问题吗?取消示例图片可以运行是因为示例图片是个四通道图像,之前的逻辑处理四通道图像会出现bug,如果不从根本原因上面解决,在标注时遇到四通道图像仍然可能会闪退。 |
方法一:
方法二:
实测两者均有效 |
抱歉,在python版本 3.11, 代码 是2.7 release,windows环境 已经复现该问题。 快速修复方法为,修改代码./paddleocr.py 中img_decode函数中515行的return cv2.imdecode(np_arr, cv2.IMREAD_UNCHANGED) 修改为 return cv2.imdecode(np_arr, cv2.IMREAD_COLOR) |
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
D:\User\Documents\PaddleOCR\Scripts\python.exe D:\Git\PaddleOCR\PPOCRLabel\PPOCRLabel.py
[2023/08/26 00:11:49] ppocr WARNING: When args.layout is false, args.ocr is automatically set to false
Traceback (most recent call last):
File "D:\Git\PaddleOCR\PPOCRLabel\PPOCRLabel.py", line 2840, in
sys.exit(main())
^^^^^^
File "D:\Git\PaddleOCR\PPOCRLabel\PPOCRLabel.py", line 2828, in main
app, _win = get_main_app(sys.argv)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Git\PaddleOCR\PPOCRLabel\PPOCRLabel.py", line 2818, in get_main_app
win = MainWindow(lang=args.lang,
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Git\PaddleOCR\PPOCRLabel\PPOCRLabel.py", line 112, in init
result = self.table_ocr('./data/paddle.png', return_ocr_result_in_table=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Git\PaddleOCR\paddleocr.py", line 759, in call
res, _ = super().call(
^^^^^^^^^^^^^^^^^
File "D:\Git\PaddleOCR\ppstructure\predict_system.py", line 129, in call
res, table_time_dict = self.table_system(
^^^^^^^^^^^^^^^^^^
File "D:\Git\PaddleOCR\ppstructure\table\predict_table.py", line 86, in call
structure_res, elapse = self._structure(copy.deepcopy(img))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Git\PaddleOCR\ppstructure\table\predict_table.py", line 109, in structure
structure_res, elapse = self.table_structurer(copy.deepcopy(img))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Git\PaddleOCR\ppstructure\table\predict_structure.py", line 120, in call
data = transform(data, self.preprocess_op)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Git\PaddleOCR\ppocr\data\imaug_init.py", line 56, in transform
data = op(data)
^^^^^^^^
File "D:\Git\PaddleOCR\ppocr\data\imaug\operators.py", line 94, in call
img.astype('float32') * self.scale - self.mean) / self.std
ValueError: operands could not be broadcast together with shapes (213,488,4) (1,1,3)
我们提供了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.
The text was updated successfully, but these errors were encountered: