Last active
          July 8, 2018 21:08 
        
      - 
      
- 
        Save CESARDELATORRE/080f9a9e89bff1f9634f281f97729cab to your computer and use it in GitHub Desktop. 
Revisions
- 
        CESARDELATORRE revised this gist Jul 8, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ var onnxPath = GetOutputPath(subDir, "SaveModelToOnnxTest.onnx"); var onnxAsJsonPath = GetOutputPath(subDir, "SaveModelToOnnxTest.json"); OnnxConverter converter = new OnnxConverter() @@ -7,7 +7,7 @@ OutputsToDrop = new[] { "Label", "Features" }, Onnx = onnxPath, Json = onnxAsJsonPath, Domain = "com.mydomain" }; converter.Convert(model); 
- 
        CESARDELATORRE created this gist Jul 6, 2018 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ var onnxPath = GetOutputPath(subDir, "SaveModelToOnnxTest.pb"); var onnxAsJsonPath = GetOutputPath(subDir, "SaveModelToOnnxTest.json"); OnnxConverter converter = new OnnxConverter() { InputsToDrop = new[] { "Label" }, OutputsToDrop = new[] { "Label", "Features" }, Onnx = onnxPath, Json = onnxAsJsonPath, Domain = "Onnx" }; converter.Convert(model); // Strip the version. var fileText = File.ReadAllText(onnxAsJsonPath); fileText = Regex.Replace(fileText, "\"producerVersion\": \"([^\"]+)\"", "\"producerVersion\": \"##VERSION##\""); File.WriteAllText(onnxAsJsonPath, fileText);