PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.3k stars 5.62k forks source link

The WarpCTCKernel does not accept INT64 label input #14794

Closed wojtuss closed 5 years ago

wojtuss commented 5 years ago

When running CRNN-CTC inference using C-API and AnalysisPredictor, I have to declare the network inputs (pixel and label) as PaddleTensors of type either PaddleDType::FLOAT or PaddleDType::INT64. So I declare the labels as INT64. However, when the execution comes to the warpctc operator https://github.com/PaddlePaddle/Paddle/blob/add98c9e7de55c72e9cf79300ba65e50934e6178/paddle/fluid/operators/warpctc_op.h#L202 and then to the check https://github.com/PaddlePaddle/Paddle/blob/add98c9e7de55c72e9cf79300ba65e50934e6178/paddle/fluid/framework/tensor_impl.h#L41 it fails, as it expects int and not long int (INT64).

Can I do anything to avoid this problem or it requires a fix to the warpctc operator?

luotao1 commented 5 years ago

Why inference need warpctc_op?

wojtuss commented 5 years ago

Actually, it is for evaluation and accuracy check. This is how python scripts execute the CRNN-CTC evaluation.

wojtuss commented 5 years ago

@luotao1 , I have just found out that I really do not need the warpctc operator. Thanks!