diff --git a/src/NnCase.Cli/Program.cs b/src/NnCase.Cli/Program.cs index f625ddd1e..9360de31e 100644 --- a/src/NnCase.Cli/Program.cs +++ b/src/NnCase.Cli/Program.cs @@ -147,7 +147,13 @@ private static async Task ConvertToTFLite(Graph graph, string tflitePath) var tmpPb = Path.GetTempFileName(); using (var f = File.Open(tmpPb, FileMode.Create, FileAccess.Write)) await ctx.SaveAsync(f); - using (var toco = Process.Start(Path.Combine(Path.GetDirectoryName(typeof(Program).Assembly.Location), "toco"), $" --input_file={tmpPb} --input_format=TENSORFLOW_GRAPHDEF --output_file={tflitePath} --output_format=TFLITE --input_shape=1,{dim[2]},{dim[3]},{dim[1]} --input_array={input} --output_array={output} --inference_type=FLOAT")) + + var binPath = Path.Combine(Path.GetDirectoryName(typeof(Program).Assembly.Location), "bin"); + var args = $" --input_file={tmpPb} --input_format=TENSORFLOW_GRAPHDEF --output_file={tflitePath} --output_format=TFLITE --input_shape=1,{dim[2]},{dim[3]},{dim[1]} --input_array={input} --output_array={output} --inference_type=FLOAT"; + using (var toco = Process.Start(new ProcessStartInfo(Path.Combine(binPath, "toco"), args) + { + WorkingDirectory = binPath + })) { toco.WaitForExit(); if (toco.ExitCode != 0)