input_shape=[125,100,100,1]
으로 모델을 훈련하여 8 개의 부동을 예측했습니다. 내 모델의 설정에 맞게 데모에서 these options을 변경했습니다.TensorFlow에서 맞춤 모델을 사용할 때의 오류 Android 카메라 데모
LOG (INFO) << "input node: " << input_tensors[0].first << ", "
<< "input shape: " << input_tensors[0].second.shape().DebugString();
tensorflow_inference_jni.cc:198 input node: input_node, input shape: [125,100,100,1]
그러나 :
가 그럼 난 배치 크기 the C++ side에서
private static final int BATCH_SIZE = 125;
에 다른 옵션을 추가, 내 텐서의 모양을보고 일부 디버그 정보를 인쇄했습니다 vars->session->Run()
함수를 호출 할 때 응용 프로그램이 충돌 함
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 16574 (InferenceThread)
나는 BATCH_SIZE = 1
(항상 충돌하지 않는 배치 크기의 125] 응용 프로그램과 훈련을 모델로 작업을 설정 이제 경우,하지만이 오류가 반환
E/native: tensorflow_inference_jni.cc:213 Error during inference: Invalid argument: Input to reshape is a tensor with 8 values, but the requested shape has 1000
[[Node: output_node = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](fullyconnected2_1/BiasAdd, output_node/shape)]]
(가)이 오류의 모양 1000를 요청 num_output 인을 * batch_size 내 생각에 (8 * 125).
내가 뭔가를 놓친 건가?
당신은 주 스레드에서 추론을 실행하고 있습니까 가진 모델을 재교육 할 때
완벽하게 작동? –
아니요, 추론을 위해 [배경 스레드] (https://github.com/tensorflow/tensorflow/blob/6b1d4fd8090d44d20fdadabf06f1a9b178c3d80c/tensorflow/examples/android/src/org/tensorflow/demo/CameraConnectionFragment.java#L428)가 있습니다. –