센서스 데이터를 사용하여 tensorflow에서 추정 API를 사용하여 넓고 깊은 모델을 만들었습니다. Java에서 모델을로드하는 동안 모델을로드 할 수없는 오류가있는 것으로 보입니다.추정기를 사용하여 자바에서 텐서 흐름 모델을로드/제공하는 중 문제
Exception in thread "main" org.tensorflow.TensorFlowException: Op type not
registered 'SparseFeatureCross' in binary running on gmalhotra-mba-2.local.
Make sure the Op and Kernel are registered in the binary running in this
process.
at org.tensorflow.SavedModelBundle.load(Native Method)
at org.tensorflow.SavedModelBundle.load(SavedModelBundle.java:39)
at deeplearning.DeepLearningTest.main(DeepLearningTest.java:32)
파이썬 코드는 아래의 모델을 저장하는데 사용 찾아주세요 같은 예외 같습니다 https://gist.github.com/gaganmalhotra/cd6a5898b9caf9005a05c8831a9b9153
다음과 같이 사용자바 코드는 다음과 같습니다
public static void main(String[] args) {
try (SavedModelBundle b = SavedModelBundle.load("/Users/gagandeep.malhotra/Documents/SampleTF_projects/temporaryModel/1510624417/", "serve")) {
Session sess = b.session();
//Create the input sensor
float[][] mat=new float[1][1];
mat[0]=new float[]{0.5f};
// create tensors specific to inputs ....
Tensor<?> x = (Tensor<?>) Tensor.create(mat);
//run the model
float[][] y = sess.runner()
.feed("input", x)
.fetch("output")
.run()
.get(0)
.copyTo(new float[1][1]);
//print the result
System.out.println(y[0][0]);
}
PS를 : Tensorflow 버전이 사용 : 1.3
를
당신이 언급하고 돌아 오는 방식으로 사용할 수있는 회피 방법에 대해 너무 많이 고맙습니다! –