Skip to content

Commit e4d87d3

Browse files
authored
Merge pull request dotnet#1 from Oceania2018/tftransferlearning
fix TensorflowUtil.LoadTFSession, ugprade TF.NET to v0.10.4.
2 parents 6ca73c2 + c3b8998 commit e4d87d3

3 files changed

Lines changed: 2 additions & 16 deletions

File tree

src/Microsoft.ML.Dnn/Microsoft.ML.Dnn.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ItemGroup>
1616
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="$(SystemIOFileSystemAccessControl)" />
1717
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindows)" />
18-
<PackageReference Include="TensorFlow.NET" Version="0.10.3" />
18+
<PackageReference Include="TensorFlow.NET" Version="0.10.4" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

src/Microsoft.ML.Dnn/TensorflowUtils.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,9 @@ internal static Session LoadTFSessionByModelFilePath(IExceptionContext ectx, str
128128

129129
private static Session LoadTFSession(IHostEnvironment env, string exportDirSavedModel)
130130
{
131-
//Contracts.Check(env != null, nameof(env));
132-
//env.CheckValue(exportDirSavedModel, nameof(exportDirSavedModel));
133-
//return Session.LoadFromSavedModel(exportDirSavedModel);
134-
135131
Contracts.Check(env != null, nameof(env));
136132
env.CheckValue(exportDirSavedModel, nameof(exportDirSavedModel));
137-
var sessionOptions = new TF_SessionOptions();
138-
sessionOptions.options = c_api.TF_NewSessionOptions();
139-
var tags = new string[] { "serve" };
140-
var graph = new Graph();
141-
TF_Buffer metaGraphDef = default;
142-
var status = new Status();
143-
var h = c_api.TF_LoadSessionFromSavedModel(sessionOptions.options, IntPtr.Zero, exportDirSavedModel, tags, 1, graph, ref metaGraphDef, status);
144-
// return new Session(h);
145-
return Session.LoadFromSavedModel(exportDirSavedModel);
146-
133+
return Session.LoadFromSavedModel(exportDirSavedModel);
147134
}
148135

149136
// A TensorFlow frozen model is a single file. An un-frozen (SavedModel) on the other hand has a well-defined folder structure.

src/Microsoft.ML.TensorFlow/Microsoft.ML.TensorFlow.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<ItemGroup>
1111
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="$(SystemIOFileSystemAccessControl)" />
1212
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindows)" />
13-
<PackageReference Include="TensorFlow.NET" Version="0.10.3" />
1413
</ItemGroup>
1514

1615
<ItemGroup>

0 commit comments

Comments
 (0)