question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

issue while loading paddlezoo MobileNetV3 (params issue)

See original GitHub issue

Description

According to the https://docs.djl.ai/docs/paddlepaddle/how_to_create_paddlepaddle_model.html, i would like to utilize mobilenetv3. I download the model and then zip folder mobilenet including two files “models and params” as mobilenet.zip. Then i provide the zip path in my os and give the mobilenet as

        Criteria<Image, Classifications> criteria;
        try {
            translator = ImageClassificationTranslator.builder()
                    .addTransform(new Resize(IMAGE_WIDTH, IMAGE_HEIGHT))
                    .addTransform(new ToTensor()) // HWC -> CHW div(255)
                    .addTransform(
                            new Normalize(
                                    new float[]{0.5f, 0.5f, 0.5f},
                                    new float[]{1.0f, 1.0f, 1.0f}))
                    .addTransform(nd -> nd.flip(0)) // RGB -> GBR
                    .build();
            criteria = Criteria.builder()
                    .optApplication(Application.CV.IMAGE_CLASSIFICATION)
                    .setTypes(Image.class, Classifications.class)
                    .optModelPath(Paths.get("models/mobilenet.zip"))
                    .optModelName("mobilenet")
                    .optTranslator(translator)
                    .build();
            model = criteria.loadModel();

at criteria.loadModel() something went wrong and exception was raised

java.io.FileNotFoundException: Parameter file with prefix: 58cef0a19dbf1b67648f54a5cfa5df2d not found in: C:\Users\cezerilab.djl.ai\cache\repo\model\undefined\ai\djl\localmodelzoo\58cef0a19dbf1b67648f54a5cfa5df2d

how can i resolve this issue? Parameter file with prefix means actually what?

Thanks for your cooperations.

Regards.

Expected Behavior

(what’s the expected behavior?)

Error Message

Ağu 19, 2021 11:25:05 PM cezeri.matrix.CMatrix setModelForInference SEVERE: null java.io.FileNotFoundException: Parameter file with prefix: 58cef0a19dbf1b67648f54a5cfa5df2d not found in: C:\Users\cezerilab.djl.ai\cache\repo\model\undefined\ai\djl\localmodelzoo\58cef0a19dbf1b67648f54a5cfa5df2d at ai.djl.mxnet.engine.MxModel.load(MxModel.java:98) at ai.djl.repository.zoo.BaseModelLoader.loadModel(BaseModelLoader.java:156) at ai.djl.repository.zoo.Criteria.loadModel(Criteria.java:174) at cezeri.matrix.CMatrix.setModelForInference(CMatrix.java:8959) at cezeri.deep_learning.ai.djl.examples.denemeler.CMatrixPattern.predictPistachioWithMobileNetV3(CMatrixPattern.java:380) at cezeri.deep_learning.ai.djl.examples.denemeler.CMatrixPattern.main(CMatrixPattern.java:42)

Exception in thread “main” java.lang.NullPointerException at cezeri.matrix.CMatrix.predictWithLabel(CMatrix.java:9022) at cezeri.deep_learning.ai.djl.examples.denemeler.CMatrixPattern.predictPistachioWithMobileNetV3(CMatrixPattern.java:387) at cezeri.deep_learning.ai.djl.examples.denemeler.CMatrixPattern.main(CMatrixPattern.java:42) C:\Users\cezerilab\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 2 seconds)

How to Reproduce?

(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)

Steps to reproduce

(Paste the commands you ran that produced the error.)

What have you tried to solve it?

Environment Info

Please run the command ./gradlew debugEnv from the root directory of DJL (if necessary, clone DJL first). It will output information about your system, environment, and installation that can help us debug your issue. Paste the output of the command below:

PASTE OUTPUT HERE

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hakmesyocommented, Aug 20, 2021

Huge thanks, i made a mistake on resize method as you mentioned, and now when i fixed it everything run well.

1reaction
frankfliucommented, Aug 20, 2021

Can you check what size you are resizing to ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ocrnet+movilenetv3加载pretrained模型异常 #1329 - GitHub
ValueError: paddle.load can not parse the file:/home/aistudio/MobileNetV3_small_x1_0_ssld_pretrained.tar. I unzip the tar file to a folder. It ...
Read more >
dynamic position on a BVH geometry - Gkjohnson/Three-Mesh-Bvh
dynamic position on a BVH geometry. ... sphere.radius = params.size; ... issue while loading paddlezoo MobileNetV3 (params issue), 7, 2021-08-19, 2022-08-19.
Read more >
"__getitem__" in LoadImagesAndLabels class - WongKinYiu ...
Hi, I found something strange in loadImagesAndLabels class when I tried to use "image_weight", ... issue while loading paddlezoo MobileNetV3 (params issue) ...
Read more >
djl - githubmemory
issue while loading paddlezoo MobileNetV3 (params issue). cwjtojava. cwjtojava CLOSED ... UnsatisfiedLinkError) in ai.djl.pytorch.jni.PyTorchLibrary.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found