File tree 3 files changed +4
-13
lines changed
3 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ VisualStudioVersion = 15.0.27130.2010
5
5
MinimumVisualStudioVersion = 10.0.40219.1
6
6
Project ("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" ) = "Digitz" , "Digitz\Digitz.csproj" , "{A5362F75-A802-4DFF-87FC-DBCCA0C5C36E}"
7
7
EndProject
8
- Project ("{888888A0-9F3D-457C-B088-3A5042F75D52}" ) = "LearnDigitz" , "LearnDigitz\LearnDigitz.pyproj" , "{AE6064DD-F103-41EF-98D8-97B6B0465B1D}"
9
- EndProject
10
8
Global
11
9
GlobalSection (SolutionConfigurationPlatforms ) = preSolution
12
10
Debug| Any CPU = Debug| Any CPU
@@ -35,14 +33,6 @@ Global
35
33
{A5362F75-A802-4DFF-87FC-DBCCA0C5C36E} .Release| x64 .Build .0 = Release| Any CPU
36
34
{A5362F75-A802-4DFF-87FC-DBCCA0C5C36E} .Release| x86 .ActiveCfg = Release| Any CPU
37
35
{A5362F75-A802-4DFF-87FC-DBCCA0C5C36E} .Release| x86 .Build .0 = Release| Any CPU
38
- {AE6064DD-F103-41EF-98D8-97B6B0465B1D} .Debug| Any CPU .ActiveCfg = Debug| Any CPU
39
- {AE6064DD-F103-41EF-98D8-97B6B0465B1D} .Debug| ARM .ActiveCfg = Debug| Any CPU
40
- {AE6064DD-F103-41EF-98D8-97B6B0465B1D} .Debug| x64 .ActiveCfg = Debug| Any CPU
41
- {AE6064DD-F103-41EF-98D8-97B6B0465B1D} .Debug| x86 .ActiveCfg = Debug| Any CPU
42
- {AE6064DD-F103-41EF-98D8-97B6B0465B1D} .Release| Any CPU .ActiveCfg = Release| Any CPU
43
- {AE6064DD-F103-41EF-98D8-97B6B0465B1D} .Release| ARM .ActiveCfg = Release| Any CPU
44
- {AE6064DD-F103-41EF-98D8-97B6B0465B1D} .Release| x64 .ActiveCfg = Release| Any CPU
45
- {AE6064DD-F103-41EF-98D8-97B6B0465B1D} .Release| x86 .ActiveCfg = Release| Any CPU
46
36
EndGlobalSection
47
37
GlobalSection (SolutionProperties ) = preSolution
48
38
HideSolutionNode = FALSE
Original file line number Diff line number Diff line change @@ -81,14 +81,15 @@ private TFTensor GetWrittenDigit(int size)
81
81
private void recognizeButton_Click ( object sender , RoutedEventArgs e )
82
82
{
83
83
var tensor = GetWrittenDigit ( 28 ) ;
84
-
84
+ const string input_node = "x" ;
85
+ const string output_node = "Model/prediction" ;
85
86
using ( var graph = new TFGraph ( ) )
86
87
{
87
88
graph . Import ( File . ReadAllBytes ( "digits.pb" ) ) ;
88
89
var session = new TFSession ( graph ) ;
89
90
var runner = session . GetRunner ( ) ;
90
- runner . AddInput ( graph [ "x" ] [ 0 ] , tensor ) ;
91
- runner . Fetch ( graph [ "Model/prediction" ] [ 0 ] ) ;
91
+ runner . AddInput ( graph [ input_node ] [ 0 ] , tensor ) ;
92
+ runner . Fetch ( graph [ output_node ] [ 0 ] ) ;
92
93
var output = runner . Run ( ) ;
93
94
TFTensor result = output [ 0 ] ;
94
95
float [ ] p = ( ( float [ ] [ ] ) result . GetValue ( true ) ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments