deepjavalibrary / djl

An Engine-Agnostic Deep Learning Framework in Java
https://djl.ai
Apache License 2.0
4.07k stars 648 forks source link

`reflect-config.json` in ai.djl:model-zoo:0.12.0 seems to refer to nonexistent class #1204

Closed scholzj closed 3 years ago

scholzj commented 3 years ago

When trying to use DJL with Quarkus (https://quarkus.io) and using the native image build, it seems to fail with following error:

Error: Error parsing reflection configuration in jar:file:/project/lib/ai.djl.model-zoo-0.12.0.jar!/META-INF/native-image/ai/djl/basicmodelzoo/reflect-config.json:
Could not resolve ai.djl.basicmodelzoo.ZooProvider for reflection configuration. Reason: java.lang.ClassNotFoundException: ai.djl.basicmodelzoo.ZooProvider. To allow unresolvable reflection configuration, use option -H:+AllowIncompleteClasspath
Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option ReflectionConfigurationResources.
com.oracle.svm.core.util.UserError$UserException: Error parsing reflection configuration in jar:file:/project/lib/ai.djl.model-zoo-0.12.0.jar!/META-INF/native-image/ai/djl/basicmodelzoo/reflect-config.json:
Could not resolve ai.djl.basicmodelzoo.ZooProvider for reflection configuration. Reason: java.lang.ClassNotFoundException: ai.djl.basicmodelzoo.ZooProvider. To allow unresolvable reflection configuration, use option -H:+AllowIncompleteClasspath

The native image build is really a black magic for me ... but my guess is that this is caused by a typo in the reflect-config.json file which refers to class ai.djl.basicmodelzoo.ZooProvider which does not exist. There is either class ai.djl.basicmodelzoo.BasicZooProvider or the class ai.djl.repository.zoo.ZooProvider which is in different JAR. I guess one of those was supposed to be used here?

frankfliu commented 3 years ago

@scholzj Thanks for reporting this issue. This is typo. I will raise a PR to address this issue.