djl icon indicating copy to clipboard operation
djl copied to clipboard

PaddlePaddle引擎使用paddleocr v4版本的模型识别图像时报错,是还不支持paddleocr的v4模型吗?

Open wxy5001 opened this issue 1 year ago • 2 comments
trafficstars

        //Application.CV.Image
        Criteria<Image, String> recognitionCriteria = Criteria.builder()
                .optEngine("PaddlePaddle")
                .setTypes(Image.class, String.class)
                .optModelPath("V:\AI\paddle\ocr\model\en_PP-OCRv4_rec_1203-02")
                .optTranslator(new PpWordRecognitionTranslator())
                .build();
        recognitionModel = recognitionCriteria.loadModel();

Image img = ImageFactory.getInstance().fromFile(Path.of(filePath)); Predictor<Image, String> recognizer = recognitionModel.newPredictor(); String text = recognizer.predict(img);

这样报错,使用paddleocr v3 版本模型时,就没有问题, 错误日志: Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j ai.djl.paddlepaddle.jni.PaddleLibrary.runInference(J[J)[J+0 j ai.djl.paddlepaddle.jni.JniUtils.predictorForward(Lai/djl/paddlepaddle/engine/PaddlePredictor;[Lai/djl/paddlepaddle/engine/PpNDArray;[Ljava/lang/String;)Lai/djl/ndarray/NDList;+57 j ai.djl.paddlepaddle.engine.PpSymbolBlock.forwardInternal(Lai/djl/training/ParameterStore;Lai/djl/ndarray/NDList;ZLai/djl/util/PairList;)Lai/djl/ndarray/NDList;+69 j ai.djl.nn.AbstractBaseBlock.forward(Lai/djl/training/ParameterStore;Lai/djl/ndarray/NDList;ZLai/djl/util/PairList;)Lai/djl/ndarray/NDList;+36 j ai.djl.nn.Block.forward(Lai/djl/training/ParameterStore;Lai/djl/ndarray/NDList;Z)Lai/djl/ndarray/NDList;+5 j ai.djl.inference.Predictor.predictInternal(Lai/djl/translate/TranslatorContext;Lai/djl/ndarray/NDList;)Lai/djl/ndarray/NDList;+21 j ai.djl.inference.Predictor.batchPredict(Ljava/util/List;)Ljava/util/List;+122 j ai.djl.inference.Predictor.predict(Ljava/lang/Object;)Ljava/lang/Object;+5 j org.example.OcrTest.recognizer(Ljava/lang/String;)Ljava/lang/String;+68 j org.example.OcrTest.main([Ljava/lang/String;)V+14 v ~StubRoutines::call_stub

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000

Register to memory mapping:

RIP=0x00007fff63398bc3 paddle_inference.dll RAX=0x0000017fdbb31d40 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 RBX=0x0000001b944fd840 is pointing into the stack for thread: 0x0000017f94697ae0 RCX=0x0000000000000028 is an unknown value RDX=0x0000000000000020 is an unknown value RSP=0x0000001b944fd500 is pointing into the stack for thread: 0x0000017f94697ae0 RBP=0x0000001b944fd8c0 is pointing into the stack for thread: 0x0000017f94697ae0 RSI=0x0000001b944fe0c0 is pointing into the stack for thread: 0x0000017f94697ae0 RDI=0x0000001b944fde30 is pointing into the stack for thread: 0x0000017f94697ae0 R8 =0x0000000000000004 is an unknown value R9 =0x0 is NULL R10=0x0000000000000240 is an unknown value R11=0x0000017fdbb31d40 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 R12=0x0 is NULL R13=0x0000017fdba461e0 points into unknown readable memory: 0x00007fff638d0d10 | 10 0d 8d 63 ff 7f 00 00 R14=0x0 is NULL R15=0x0 is NULL

Registers: RAX=0x0000017fdbb31d40, RBX=0x0000001b944fd840, RCX=0x0000000000000028, RDX=0x0000000000000020 RSP=0x0000001b944fd500, RBP=0x0000001b944fd8c0, RSI=0x0000001b944fe0c0, RDI=0x0000001b944fde30 R8 =0x0000000000000004, R9 =0x0000000000000000, R10=0x0000000000000240, R11=0x0000017fdbb31d40 R12=0x0000000000000000, R13=0x0000017fdba461e0, R14=0x0000000000000000, R15=0x0000000000000000 RIP=0x00007fff63398bc3, EFLAGS=0x0000000000010246

Top of Stack: (sp=0x0000001b944fd500) 0x0000001b944fd500: 0000001b944fd550 0000001b944fd840 0x0000001b944fd510: 0000001b944fe0c0 0000001b944fde30 0x0000001b944fd520: fffffffffffffffe 0000000000000000 0x0000001b944fd530: 0000017fdb8146f0 00007fff636b5079 0x0000001b944fd540: 00000006dbbed6e0 0000017f00000004 0x0000001b944fd550: 0000017fdbb31d40 0000017fdbb31d68 0x0000001b944fd560: 0000017fdbb31d68 fffffffffffffffe 0x0000001b944fd570: fffffffffffffffe 0000017fdbbed6e0 0x0000001b944fd580: 0000001b944fd601 0000017fe378d060 0x0000001b944fd590: 00000000187f6000 0000000000000000 0x0000001b944fd5a0: 0000000000000000 0000000000000000 0x0000001b944fd5b0: 0000017fdb8146a0 0000000000000000 0x0000001b944fd5c0: 0000000000000001 0000000000000078 0x0000001b944fd5d0: 0000000000000001 0000000000000028 0x0000001b944fd5e0: 0000000000000000 0000000000000000 0x0000001b944fd5f0: 0000000000000000 0000000000000000

Instructions: (pc=0x00007fff63398bc3) 0x00007fff63398ac3: ff ff ff 48 8b 05 cb 8a dd 00 48 33 c4 48 89 84 0x00007fff63398ad3: 24 80 02 00 00 49 8b f1 4d 8b f0 48 8b da 48 8b 0x00007fff63398ae3: f9 48 8b 01 48 8d 94 24 c0 00 00 00 ff 50 10 48 0x00007fff63398af3: 8b 84 24 08 01 00 00 89 44 24 48 c7 44 24 44 06 0x00007fff63398b03: 00 00 00 83 f8 06 0f 8f 64 01 00 00 48 8b d3 48 0x00007fff63398b13: 8d 8c 24 98 00 00 00 e8 31 1c 69 fe 45 33 c9 4c 0x00007fff63398b23: 8d 84 24 c0 00 00 00 48 8b d0 48 8d 8c 24 d0 01 0x00007fff63398b33: 00 00 e8 a6 a8 e8 ff 48 8b 06 48 8d 94 24 d0 01 0x00007fff63398b43: 00 00 48 8b ce ff 50 28 48 8b 84 24 d0 01 00 00 0x00007fff63398b53: 48 39 84 24 c0 00 00 00 75 0c 48 8b 06 48 8b d7 0x00007fff63398b63: 48 8b ce ff 50 40 8b 84 24 08 01 00 00 ff c0 48 0x00007fff63398b73: 63 d0 4c 8d 44 24 40 48 8d 4c 24 50 e8 dc 69 6b 0x00007fff63398b83: fe 90 45 33 c0 48 8b 44 24 50 4c 89 00 44 39 84 0x00007fff63398b93: 24 08 01 00 00 7e 29 41 8b d0 0f 1f 00 48 8b 8c 0x00007fff63398ba3: 14 c0 00 00 00 48 8b 44 24 50 48 89 4c 02 08 41 0x00007fff63398bb3: ff c0 48 8d 52 08 44 3b 84 24 08 01 00 00 7c dd 0x00007fff63398bc3: 49 8b 1e 48 8d 54 24 50 48 8d 8c 24 80 01 00 00 0x00007fff63398bd3: e8 c8 1d 9d fe 48 8b d0 49 8b ce ff 53 28 49 8b 0x00007fff63398be3: 06 48 8b d7 49 8b ce ff 50 40 49 8b 1e 48 8b 07 0x00007fff63398bf3: 48 8b cf ff 50 18 8b d0 49 8b ce ff 53 30 48 8b 0x00007fff63398c03: 1e 48 8b 07 48 8b cf ff 50 18 8b d0 48 8b ce ff 0x00007fff63398c13: 53 30 90 48 8b 4c 24 50 48 85 c9 74 36 48 8b 54 0x00007fff63398c23: 24 60 48 2b d1 48 83 e2 f8 48 8b c1 48 81 fa 00 0x00007fff63398c33: 10 00 00 72 19 48 83 c2 27 48 8b 49 f8 48 2b c1 0x00007fff63398c43: 48 83 c0 f8 48 83 f8 1f 0f 87 5b 01 00 00 e8 7a 0x00007fff63398c53: 1a 0e 00 48 8b 8c 24 80 02 00 00 48 33 cc e8 6a 0x00007fff63398c63: 1f 0e 00 48 81 c4 98 02 00 00 41 5e 5f 5e 5b c3 0x00007fff63398c73: 48 8d 94 24 c0 00 00 00 48 8d 8c 24 80 01 00 00 0x00007fff63398c83: e8 58 5c 90 fe 48 8b d8 48 8d 8c 24 c0 00 00 00 0x00007fff63398c93: e8 08 02 73 fe 44 8b c0 4c 8b cb 48 8d 15 5b 55 0x00007fff63398ca3: 73 00 48 8d 8c 24 10 01 00 00 e8 9e ef 93 fe 90 0x00007fff63398cb3: 4c 8d 44 24 44 48 8d 35 25 6a 5f 00 48 8b d6 48

Stack slot to memory mapping: stack at sp + 0 slots: 0x0000001b944fd550 is pointing into the stack for thread: 0x0000017f94697ae0 stack at sp + 1 slots: 0x0000001b944fd840 is pointing into the stack for thread: 0x0000017f94697ae0 stack at sp + 2 slots: 0x0000001b944fe0c0 is pointing into the stack for thread: 0x0000017f94697ae0 stack at sp + 3 slots: 0x0000001b944fde30 is pointing into the stack for thread: 0x0000017f94697ae0 stack at sp + 4 slots: 0xfffffffffffffffe is an unknown value stack at sp + 5 slots: 0x0 is NULL stack at sp + 6 slots: 0x0000017fdb8146f0 points into unknown readable memory: 0x000000003f800000 | 00 00 80 3f 00 00 00 00 stack at sp + 7 slots: 0x00007fff636b5079 paddle_inference.dll

--------------- P R O C E S S ---------------

Threads class SMR info: _java_thread_list=0x0000017fdbd1d6f0, length=17, elements={ 0x0000017f94697ae0, 0x0000017fb7c43270, 0x0000017fb7c446f0, 0x0000017fb7c66960, 0x0000017fb7c67320, 0x0000017fb7c67ed0, 0x0000017fb7c6a890, 0x0000017fb7c6b620, 0x0000017fb7c779e0, 0x0000017fb7c7b910, 0x0000017fb7e30a60, 0x0000017fb7f07500, 0x0000017fb8081b60, 0x0000017fb8083090, 0x0000017fdb3fa5b0, 0x0000017fdb920cb0, 0x0000017ffbfc35b0 }

Java Threads: ( => current thread ) =>0x0000017f94697ae0 JavaThread "main" [_thread_in_native, id=8720, stack(0x0000001b94400000,0x0000001b94500000)] 0x0000017fb7c43270 JavaThread "Reference Handler" daemon [_thread_blocked, id=16084, stack(0x0000001b94b00000,0x0000001b94c00000)] 0x0000017fb7c446f0 JavaThread "Finalizer" daemon [_thread_blocked, id=2488, stack(0x0000001b94c00000,0x0000001b94d00000)] 0x0000017fb7c66960 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=14300, stack(0x0000001b94d00000,0x0000001b94e00000)] 0x0000017fb7c67320 JavaThread "Attach Listener" daemon [_thread_blocked, id=16216, stack(0x0000001b94e00000,0x0000001b94f00000)] 0x0000017fb7c67ed0 JavaThread "Service Thread" daemon [_thread_blocked, id=18632, stack(0x0000001b94f00000,0x0000001b95000000)] 0x0000017fb7c6a890 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=18764, stack(0x0000001b95000000,0x0000001b95100000)] 0x0000017fb7c6b620 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=13592, stack(0x0000001b95100000,0x0000001b95200000)] 0x0000017fb7c779e0 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=7228, stack(0x0000001b95200000,0x0000001b95300000)] 0x0000017fb7c7b910 JavaThread "Sweeper thread" daemon [_thread_blocked, id=7180, stack(0x0000001b95300000,0x0000001b95400000)] 0x0000017fb7e30a60 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=18380, stack(0x0000001b95400000,0x0000001b95500000)] 0x0000017fb7f07500 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=2304, stack(0x0000001b95500000,0x0000001b95600000)] 0x0000017fb8081b60 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=19360, stack(0x0000001b95900000,0x0000001b95a00000)] 0x0000017fb8083090 JavaThread "Notification Thread" daemon [_thread_blocked, id=16280, stack(0x0000001b95a00000,0x0000001b95b00000)] 0x0000017fdb3fa5b0 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=15432, stack(0x0000001b95600000,0x0000001b95700000)] 0x0000017fdb920cb0 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=15508, stack(0x0000001b95700000,0x0000001b95800000)] 0x0000017ffbfc35b0 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=19204, stack(0x0000001b95800000,0x0000001b95900000)]

wxy5001 avatar Jun 15 '24 04:06 wxy5001

pom.xml使用的版本如下: <groupId>ai.djl.paddlepaddle</groupId> <artifactId>paddlepaddle-engine</artifactId> 0.27.0 <groupId>ai.djl.paddlepaddle</groupId> <artifactId>paddlepaddle-model-zoo</artifactId> 0.27.0

    <!-- DJL Core Library -->
    <dependency>
        <groupId>ai.djl</groupId>
        <artifactId>api</artifactId>
        <version>0.28.0</version>
    </dependency>

谢谢。

wxy5001 avatar Jun 15 '24 04:06 wxy5001

This looks like a Paddle bug. Due to lack of support from Paddle community, we have removed Paddle since 0.28.0

frankfliu avatar Jun 16 '24 02:06 frankfliu