Replies: 1 comment
-
您好,目前PP-OCRv5还不支持压缩训练,这个等我们后续官方支持哈~ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
paddleocr版本是3.0.2
paddleslim 版本是2.6
使用的是configs/ppocrv4/ppocrv4_rec_qat_dist.yaml改的配置,模型文件改成出现
model_filename: inference.json
params_filename: inference.pdiparams
出现下面错误, 请问要怎么解决
Traceback (most recent call last):
File "run.py", line 175, in
main()
File "run.py", line 158, in main
ac = AutoCompression(
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/paddleslim/auto_compression/compressor.py", line 161, in init
self.default_distill_node_pair, self.model_type = self._get_model_info()
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/paddleslim/auto_compression/compressor.py", line 321, in _get_model_info
final_weight_node = find_final_nodes(inference_program)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/paddleslim/common/patterns.py", line 31, in find_final_nodes
graph = GraphWrapper(program)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/paddleslim/core/graph_wrapper.py", line 245, in init
self.persistables[var.name] = var
ValueError: (InvalidArgument) Currently, we can only get name of Value from DataOp/ParameterOp/BlockArgument/ConstantTensorOp/SetParameterOp and ShadowOutputOp. (at ../paddle/fluid/pir/utils/name_analysis.cc:281)
完整的输出是:
----------- Running Arguments -----------
Distillation:
alpha: [1.0, 1.0]
loss: ['skd', 'l2']
node: [['softmax_11.tmp_0'], ['linear_170.tmp_1']]
Eval:
dataset:
data_dir: train_data/
label_file_list: ['train_data/val_list.txt']
name: SimpleDataSet
transforms: [{'DecodeImage': {'img_mode': 'BGR', 'channel_first': False}}, {'MultiLabelEncode': {'gtc_encode': 'NRTRLabelEncode'}}, {'RecResizeImg': {'image_shape': [3, 48, 320]}}, {'KeepKeys': {'keep_keys': ['image', 'label_ctc', 'label_gtc', 'length', 'valid_ratio']}}]
loader:
batch_size_per_card: 1
drop_last: False
num_workers: 0
shuffle: False
Global:
algorithm: SVTR
character_dict_path: ./ppocr_keys_v1.txt
max_text_length: 25
model_dir: ./models/cc
model_filename: inference.json
model_type: rec
params_filename: inference.pdiparams
use_space_char: True
Metric:
ignore_space: False
main_indicator: acc
name: RecMetric
PostProcess:
name: CTCLabelDecode
QuantAware:
activation_bits: 8
activation_quantize_type: moving_average_abs_max
is_full_quantize: False
not_quant_pattern: ['skip_quant']
onnx_format: False
quantize_op_types: ['conv2d']
use_pact: False
weight_bits: 8
weight_quantize_type: channel_wise_abs_max
Train:
dataset:
data_dir: train_data/
ds_width: False
ext_op_transform_idx: 1
label_file_list: ['train_data/train_list.txt']
name: MultiScaleDataSet
transforms: [{'DecodeImage': {'img_mode': 'BGR', 'channel_first': False}}, {'RecConAug': {'prob': 0.5, 'ext_data_num': 2, 'image_shape': [48, 320, 3], 'max_text_length': 25}}, {'RecAug': None}, {'MultiLabelEncode': {'gtc_encode': 'NRTRLabelEncode'}}, {'KeepKeys': {'keep_keys': ['image', 'label_ctc', 'label_gtc', 'length', 'valid_ratio']}}]
loader:
batch_size_per_card: 64
drop_last: True
num_workers: 0
shuffle: True
sampler:
divided_factor: [8, 16]
first_bs: 64
fix_bs: False
is_training: True
name: MultiScaleSampler
scales: [[320, 32], [320, 48], [320, 64]]
TrainConfig:
epochs: 1
eval_iter: 1000
learning_rate:
learning_rate: 1e-05
type: CosineAnnealingDecay
logging_iter: 100
optimizer_builder:
optimizer:
type: Adam
weight_decay: 5e-05
2025-06-24 14:18:20,925-INFO: Initialize indexes of datasets:['train_data/train_list.txt']
2025-06-24 14:18:21,023-INFO: Initialize indexes of datasets:['train_data/val_list.txt']
total training steps: 99
Tue Jun 24 14:18:21-WARNING: The old way to load inference model is deprecated. Please specify path_prefix. model path: /mnt/workspace/ocr/PaddleOCR/deploy/slim/auto_compression/models/cc/inference.json, params path: /mnt/workspace/ocr/PaddleOCR/deploy/slim/auto_compression/models/cc/inference.pdiparams
Tue Jun 24 14:18:21-WARNING: The old way to load inference model is deprecated. Please specify path_prefix. model path: /mnt/workspace/ocr/PaddleOCR/deploy/slim/auto_compression/models/cc/inference.json, params path: /mnt/workspace/ocr/PaddleOCR/deploy/slim/auto_compression/models/cc/inference.pdiparams
W0624 14:18:21.390522 63932 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.1, Runtime API Version: 12.6
W0624 14:18:21.391072 63932 gpu_resources.cc:164] device: 0, cuDNN Version: 9.5.
W0624 14:18:21.391086 63932 gpu_resources.cc:196] WARNING: device: 0. The installed Paddle is compiled with CUDA 12.6, but CUDA runtime version in your machine is 12.1, which may cause serious incompatible bug. Please recompile or reinstall Paddle with compatible CUDA version.
2025-06-24 14:18:22,851-INFO: devices: gpu
Tue Jun 24 14:18:22-WARNING: The old way to load inference model is deprecated. Please specify path_prefix. model path: /mnt/workspace/ocr/PaddleOCR/deploy/slim/auto_compression/models/cc/inference.json, params path: /mnt/workspace/ocr/PaddleOCR/deploy/slim/auto_compression/models/cc/inference.pdiparams
Traceback (most recent call last):
File "run.py", line 175, in
main()
File "run.py", line 158, in main
ac = AutoCompression(
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/paddleslim/auto_compression/compressor.py", line 161, in init
self.default_distill_node_pair, self.model_type = self._get_model_info()
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/paddleslim/auto_compression/compressor.py", line 321, in _get_model_info
final_weight_node = find_final_nodes(inference_program)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/paddleslim/common/patterns.py", line 31, in find_final_nodes
graph = GraphWrapper(program)
File "/root/.pyenv/versions/3.8.18/lib/python3.8/site-packages/paddleslim/core/graph_wrapper.py", line 245, in init
self.persistables[var.name] = var
ValueError: (InvalidArgument) Currently, we can only get name of Value from DataOp/ParameterOp/BlockArgument/ConstantTensorOp/SetParameterOp and ShadowOutputOp. (at ../paddle/fluid/pir/utils/name_analysis.cc:281)
Beta Was this translation helpful? Give feedback.
All reactions