-
I am having trouble loading a model that is shown here . If I use the RESNET load directly I have no problems. Debug shows the following lines:
So several models are found with matching input and output. Documentation says the first one should be selected. Can anyone tell me what I am doing wrong? One thing I have noticed is the null GroupId of the matches is null. Also I have 2 engines loaded.Is this an issue? (Note: I have posted this in slack) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
@hmf Can you provide your Criteria code? |
Beta Was this translation helpful? Give feedback.
-
@frankfliu I followed the example the only difference it being in Scala. Here is the code: import ai.djl.Application
import ai.djl.basicmodelzoo.BasicModelZoo
import ai.djl.modality.Classifications.Classification
import ai.djl.modality.cv.Image
import ai.djl.modality.cv.output.DetectedObjects
import ai.djl.repository.Artifact
import ai.djl.repository.zoo.{Criteria, ModelZoo, ZooModel}
import org.tensorflow.TensorFlow
import java.util
val criteria: Criteria[Image, Classification] = Criteria.builder()
.optApplication(Application.CV.IMAGE_CLASSIFICATION)
.setTypes(classOf[Image], classOf[Classification])
//.optFilter("layers", "50")
//.optFilter("flavor", "v1")
//.optFilter("dataset", "cifar10")
.build()
val ssd: ZooModel[Image, Classification] = ModelZoo.loadModel(criteria) I have noticed that not all criteria seem to have an effect on the selection. For example the val c0 = Criteria.builder()
.optModelZoo(new BasicModelZoo())
.optEngine("MXNet") // used, not working PyTorch, MXNet, Tensorflow
.optArtifactId("ssd") // set when application not use (#) yolo, coco, ssd
//.optGroupId("ai.djl.tensorflow") // ??
.optApplication(Application.CV.OBJECT_DETECTION) // used
.setTypes(classOf[Image], classOf[DetectedObjects])
.optFilter("dataset", "openimages_v4")
.build()
println(ModelZoo.listModels(c0)) I get:
Note that I would expect a single model due to the filter, but I don't. In addition to this if I add group id I nothing changes. What is even stranger is that if I add the code: println("000000000000000000")
val artifactId = c0.getArtifactId
val modelZoo: ModelZoo = c0.getModelZoo // Error not set
val groupId: String = c0.getGroupId
val engine: String = c0.getEngine
val application: Application = c0.getApplication
// Not used
val input = c0.getInputClass
val output = c0.getOutputClass
println(artifactId)
println(modelZoo)
println(groupId)
println(engine)
println(application)
println("** Not used")
println(input)
println(output)
println("11111111111111111111") I get:
Why do I get back those nulls? TIA |
Beta Was this translation helpful? Give feedback.
-
Should I report this as a documentation issue? |
Beta Was this translation helpful? Give feedback.
@frankfliu I followed the example the only difference it being in Scala. Here is the code: