PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.18k stars 7.82k forks source link

No member function is_cpu and is_gpu #8904

Closed pangzilovepeace closed 1 year ago

pangzilovepeace commented 1 year ago

When I try to train the detection model, I get the error message: /home/PaddleOCR/ppocr/ext_op/roi_align_rotated/roi_align_rotated.cc: In function ‘std::vector RoIAlignRotatedBackward(const Tensor&, const Tensor&, const Tensor&, int, int, float, int, bool, bool)’: /home/PaddleOCR/ppocr/ext_op/roi_align_rotated/roi_align_rotated.cc:481:13: error: ‘const Tensor’ {aka ‘const class paddle::Tensor’} has no member named ‘is_cpu’ if (input.is_cpu()) { ^~ /home/PaddleOCR/ppocr/ext_op/roi_align_rotated/roi_align_rotated.cc:486:20: error: ‘const Tensor’ {aka ‘const class paddle::Tensor’} has no member named ‘is_gpu’ } else if (input.is_gpu()) {

The comment I use to train is: python3 tools/train.py -c configs/det/det_r50_drrg_ctw.yml -o Global.pretrained_model=./pretrain_models/MobileNetV3_large_x0_5_pretrained.pdparams

LDOUBLEV commented 1 year ago

Can you provide the paddle version used.

pangzilovepeace commented 1 year ago

I use "git clone https://github.com/PaddlePaddle/PaddleOCR" to get the Paddle Repo. Its paddle version 2.1.3 from release/2.6

Thank you.

Can you provide the paddle version used.

pangzilovepeace commented 1 year ago

@LDOUBLEV Can you reproduce the bug on your side? Thank you.

LDOUBLEV commented 1 year ago

It works for me with PaddleOCR release/2.6 and paddlepaddle-gpu 2.3.2