No matching model with specified Input/Output type found.
See original GitHub issueDescription
I’m trying to load a custom object detection model object detection model trained via a pytorch script. The model is saved as a .pt file. The mlnet.pt file is saved inside my eclipse workspace, which is where I’m running the code from. So the absolute path of the model to load is : “/Users/dpapp/eclipse-workspace/mlProject/src/mlnet/mlnet.pt”
I try to load this model using the following code:
Criteria<Image, DetectedObjects> criteria =
Criteria.builder()
.optApplication(Application.CV.OBJECT_DETECTION)
.setTypes(Image.class, DetectedObjects.class)
.optModelUrls("file:///Users/dpapp/eclipse-workspace/mlProject/src/mlnet")
.build();
ZooModel model = criteria.loadModel();
However, I get the error message shown below.
Expected Behavior
I expect the model to successfully be loaded.
Error Message
ai.djl.repository.zoo.ModelNotFoundException: No matching model with specified Input/Output type found.
at ai.djl.repository.zoo.Criteria.loadModel(Criteria.java:178)
at main.main(main.java:86)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:254)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: ai.djl.repository.zoo.ModelNotFoundException: No supported engine available for model zoo: ai.djl.localmodelzoo
at ai.djl.repository.zoo.BaseModelLoader.loadModel(BaseModelLoader.java:135)
at ai.djl.repository.zoo.Criteria.loadModel(Criteria.java:166)
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.)
- Save mlnet.pt model in the following location: “/Users/dpapp/eclipse-workspace/mlProject/src/mlnet/mlnet.pt”
- Criteria<Image, DetectedObjects> criteria = Criteria.builder() .optApplication(Application.CV.OBJECT_DETECTION) .setTypes(Image.class, DetectedObjects.class) .optModelUrls(“file:///Users/dpapp/eclipse-workspace/mlProject/src/mlnet”) .build(); ZooModel model = criteria.loadModel();
What have you tried to solve it?
- I’ve tried both absolute and relative paths.
- I’ve tried different criteria input and output types, including a generic <?, ?>
- I’ve tried setting the optModelName parameter
Environment Info
maven inside eclipse
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Loading trained model with custom dataset · Issue #220 - GitHub
ModelNotFoundException: No matching model with specified Input/Output type found. at ai.djl.repository.zoo.ModelZoo.
Read more >Model Loading | djl - Deep Java Library
Note: If multiple models match the criteria you specified, the first one will be returned. The result is not deterministic.
Read more >Specify Time-Domain Requirements - MATLAB & Simulink
You can specify a signal matching requirement to match model outputs to measured signals. This requirement is also known as an experiment in...
Read more >DJL目标检测Demo – 闪念基因– 个人技术分享
问题2:Exception in thread “main” ai.djl.repository.zoo.ModelNotFoundException: No matching model with specified Input/Output type found.
Read more >Troubleshooting - nf-core
Direct input; Output for only a single sample although I specified multiple with ... Tool not found; Error related to Docker; Error related...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You need use
jit.trace()
to export your model. libtorch C++ api only support traced script model: https://docs.djl.ai/docs/pytorch/how_to_convert_your_model_to_torchscript.htmlSee this PyTorch issue: https://github.com/pytorch/pytorch/issues/47917
@davpapp each SSD model processing are quite different, it’s really depends on how you trained it.
.optModelPath()
if you load from local file system.