forked from huawei/mindspore2022
fix log print
This commit is contained in:
parent
804cbe1867
commit
85298e9f60
|
|
@ -61,7 +61,7 @@ public class Main {
|
|||
private static boolean run() {
|
||||
MSTensor inputTensor = model.getInputByTensorName("graph_input-173");
|
||||
if (inputTensor.getDataType() != DataType.kNumberTypeFloat32) {
|
||||
System.err.println("Input tensor shape do not float, the data type is " + inputTensor.getDataType());
|
||||
System.err.println("Input tensor data type is not float, the data type is " + inputTensor.getDataType());
|
||||
return false;
|
||||
}
|
||||
// Generator Random Data.
|
||||
|
|
@ -91,7 +91,7 @@ public class Main {
|
|||
}
|
||||
msgSb.append("]");
|
||||
if (outTensor.getDataType() != DataType.kNumberTypeFloat32) {
|
||||
System.err.println("output tensor shape do not float, the data type is " + outTensor.getDataType());
|
||||
System.err.println("output tensor data type is not float, the data type is " + outTensor.getDataType());
|
||||
return false;
|
||||
}
|
||||
float[] result = outTensor.getFloatData();
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
}
|
||||
msgSb.append("]");
|
||||
if (outTensor.getDataType() != DataType.kNumberTypeFloat32) {
|
||||
Log.e(TAG, "output tensor shape do not float, the data type is " + outTensor.getDataType());
|
||||
Log.e(TAG, "output tensor data type is not float, the data type is " + outTensor.getDataType());
|
||||
return false;
|
||||
}
|
||||
float[] result = outTensor.getFloatData();
|
||||
|
|
@ -143,7 +143,7 @@ public class MainActivity extends AppCompatActivity {
|
|||
Log.i(TAG, "runInference: ");
|
||||
MSTensor inputTensor = model.getInputByTensorName("graph_input-173");
|
||||
if (inputTensor.getDataType() != DataType.kNumberTypeFloat32) {
|
||||
Log.e(TAG, "Input tensor shape do not float, the data type is " + inputTensor.getDataType());
|
||||
Log.e(TAG, "Input tensor data type is not float, the data type is " + inputTensor.getDataType());
|
||||
return false;
|
||||
}
|
||||
// Generator Random Data.
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ public class NetRunner {
|
|||
max_acc = acc;
|
||||
}
|
||||
System.out.println("step_" + (i + 1) + ": \tLoss is " + loss + " [min=" + min_loss + "]" + " " +
|
||||
"max_accc=" + max_acc);
|
||||
"max_acc=" + max_acc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class Benchmark {
|
|||
for (int i = 0; i < session.getInputs().size(); i++) {
|
||||
MSTensor inputTensor = session.getInputs().get(i);
|
||||
if (inputTensor.getDataType() != DataType.kNumberTypeFloat32) {
|
||||
System.err.println("Input tensor shape do not float, the data type is " + inputTensor.getDataType());
|
||||
System.err.println("Input tensor data type is not float, the data type is " + inputTensor.getDataType());
|
||||
freeBuffer();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue