issue while loading paddlezoo MobileNetV3 (params issue)
See original GitHub issueDescription
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:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Huge thanks, i made a mistake on resize method as you mentioned, and now when i fixed it everything run well.
Can you check what size you are resizing to ?