when I execute " package org.deeplearning4j.modelimportexamples.tf.advanced.bert.BertInferenceExample",some error happened.
the following is error log:
Exception in thread "main" java.lang.UnsupportedOperationException: Cannot get array for ARRAY type SDVariable - use SDVariable.exec or SameDiff.output instead
at org.nd4j.autodiff.samediff.SameDiff.getArrForVarName(SameDiff.java:747)
at org.nd4j.imports.graphmapper.tf.TFGraphMapper.initFunctionFromProperties(TFGraphMapper.java:826)
at org.nd4j.linalg.api.ops.impl.shape.Gather.initFromTensorFlow(Gather.java:99)
at org.nd4j.imports.graphmapper.tf.TFGraphMapper.importGraph(TFGraphMapper.java:356)
at org.nd4j.imports.graphmapper.tf.TFGraphMapper.importGraph(TFGraphMapper.java:141)
at org.nd4j.imports.graphmapper.tf.TFGraphMapper.importGraph(TFGraphMapper.java:87)
at org.nd4j.imports.graphmapper.tf.TFGraphMapper.importGraph(TFGraphMapper.java:73)
at org.nd4j.autodiff.samediff.SameDiff.importFrozenTF(SameDiff.java:5751)
at org.deeplearning4j.examples.mine.learn01.ImportPBFile.main(ImportPBFile.java:12)
Version Information
Please indicate relevant versions, including, if relevant:
<dl4j-master.version>1.0.0-M1.1</dl4j-master.version>
I work on windows10
Thank you for replying my issue!
I follow this Tutorials,and I have put necessary files into src/main/resources:
Then,I got this error:
Exception in thread "main" java.lang.IllegalArgumentException: No import process defined for IteratorV2
at org.nd4j.samediff.frameworkimport.registry.OpMappingRegistry.lookupOpMappingProcess(OpMappingRegistry.kt:129)
at org.nd4j.samediff.frameworkimport.tensorflow.ir.TensorflowIRNode.<init>(TensorflowIRNode.kt:45)
at org.nd4j.samediff.frameworkimport.tensorflow.ir.TensorflowIRGraph.nodeList(TensorflowIRGraph.kt:78)
at org.nd4j.samediff.frameworkimport.ir.IRFunctionsKt.importInfoForEachNodeInGraph(IRFunctions.kt:49)
at org.nd4j.samediff.frameworkimport.tensorflow.ir.TensorflowIRGraph.importInfoForEachNode(TensorflowIRGraph.kt:152)
at org.nd4j.samediff.frameworkimport.ImportGraph.importGraph(ImportGraph.kt:227)
at org.nd4j.samediff.frameworkimport.tensorflow.importer.TensorflowFrameworkImporter.importFromGraph(TensorflowFrameworkImporter.kt:58)
at org.nd4j.samediff.frameworkimport.tensorflow.importer.TensorflowFrameworkImporter.runImport(TensorflowFrameworkImporter.kt:64)
at org.deeplearning4j.modelimportexamples.tf.advanced.bert.BertInferenceExample.main(BertInferenceExample.java:81)
@benbenwt perfect thanks. Since you posted your model, I’ll take a look. I imported a different version of BERT just fine, but may need to add more definitions. Of note here, you did do everything correctly.