@@ -108,7 +108,7 @@ public void TensorFlowTransforCifarEndToEndTest2()
108
108
{
109
109
var imageHeight = 32 ;
110
110
var imageWidth = 32 ;
111
- var model_location = "cifar_model/frozen_model.pb" ;
111
+ var modelLocation = "cifar_model/frozen_model.pb" ;
112
112
var dataFile = GetDataPath ( "images/images.tsv" ) ;
113
113
var imageFolder = Path . GetDirectoryName ( dataFile ) ;
114
114
@@ -125,7 +125,7 @@ public void TensorFlowTransforCifarEndToEndTest2()
125
125
var pipeEstimator = new ImageLoadingEstimator ( mlContext , imageFolder , ( "ImageReal" , "ImagePath" ) )
126
126
. Append ( new ImageResizingEstimator ( mlContext , "ImageCropped" , imageHeight , imageWidth , "ImageReal" ) )
127
127
. Append ( new ImagePixelExtractingEstimator ( mlContext , "Input" , "ImageCropped" , interleavePixelColors : true ) )
128
- . Append ( mlContext . Model . LoadTensorFlowModel ( model_location ) . ScoreTensorFlowModel ( "Output" , "Input" ) )
128
+ . Append ( mlContext . Model . LoadTensorFlowModel ( modelLocation ) . ScoreTensorFlowModel ( "Output" , "Input" ) )
129
129
. Append ( new ColumnConcatenatingEstimator ( mlContext , "Features" , "Output" ) )
130
130
. Append ( new ValueToKeyMappingEstimator ( mlContext , "Label" ) )
131
131
. AppendCacheCheckpoint ( mlContext )
@@ -345,7 +345,7 @@ private class TypesData
345
345
public void TensorFlowTransformInputOutputTypesTest ( )
346
346
{
347
347
// This an identity model which returns the same output as input.
348
- var model_location = "model_types_test" ;
348
+ var modelLocation = "model_types_test" ;
349
349
350
350
//Data
351
351
var data = new List < TypesData > (
@@ -382,7 +382,7 @@ public void TensorFlowTransformInputOutputTypesTest()
382
382
383
383
var inputs = new string [ ] { "f64" , "f32" , "i64" , "i32" , "i16" , "i8" , "u64" , "u32" , "u16" , "u8" , "b" } ;
384
384
var outputs = new string [ ] { "o_f64" , "o_f32" , "o_i64" , "o_i32" , "o_i16" , "o_i8" , "o_u64" , "o_u32" , "o_u16" , "o_u8" , "o_b" } ;
385
- var trans = mlContext . Model . LoadTensorFlowModel ( model_location ) . ScoreTensorFlowModel ( outputs , inputs ) . Fit ( loader ) . Transform ( loader ) ; ;
385
+ var trans = mlContext . Model . LoadTensorFlowModel ( modelLocation ) . ScoreTensorFlowModel ( outputs , inputs ) . Fit ( loader ) . Transform ( loader ) ; ;
386
386
387
387
using ( var cursor = trans . GetRowCursorForAllColumns ( ) )
388
388
{
@@ -546,8 +546,8 @@ public void TensorFlowTransformInceptionTest()
546
546
public void TensorFlowInputsOutputsSchemaTest ( )
547
547
{
548
548
var mlContext = new MLContext ( seed : 1 ) ;
549
- var model_location = "mnist_model/frozen_saved_model.pb" ;
550
- var schema = TensorFlowUtils . GetModelSchema ( mlContext , model_location ) ;
549
+ var modelLocation = "mnist_model/frozen_saved_model.pb" ;
550
+ var schema = TensorFlowUtils . GetModelSchema ( mlContext , modelLocation ) ;
551
551
Assert . Equal ( 86 , schema . Count ) ;
552
552
Assert . True ( schema . TryGetColumnIndex ( "Placeholder" , out int col ) ) ;
553
553
var type = ( VectorDataViewType ) schema [ col ] . Type ;
@@ -607,8 +607,8 @@ public void TensorFlowInputsOutputsSchemaTest()
607
607
Assert . Equal ( 1 , inputOps . Length ) ;
608
608
Assert . Equal ( "sequential/dense_1/BiasAdd" , inputOps . GetValues ( ) [ 0 ] . ToString ( ) ) ;
609
609
610
- model_location = "model_matmul/frozen_saved_model.pb" ;
611
- schema = TensorFlowUtils . GetModelSchema ( mlContext , model_location ) ;
610
+ modelLocation = "model_matmul/frozen_saved_model.pb" ;
611
+ schema = TensorFlowUtils . GetModelSchema ( mlContext , modelLocation ) ;
612
612
char name = 'a' ;
613
613
for ( int i = 0 ; i < schema . Count ; i ++ )
614
614
{
@@ -663,7 +663,7 @@ public void TensorFlowTransformMNISTLRTrainingTest()
663
663
{
664
664
const double expectedMicroAccuracy = 0.72173913043478266 ;
665
665
const double expectedMacroAccruacy = 0.67482993197278918 ;
666
- var model_location = "mnist_lr_model" ;
666
+ var modelLocation = "mnist_lr_model" ;
667
667
try
668
668
{
669
669
var mlContext = new MLContext ( seed : 1 ) ;
@@ -686,7 +686,7 @@ public void TensorFlowTransformMNISTLRTrainingTest()
686
686
labelColumnName : "OneHotLabel" ,
687
687
dnnLabel : "Label" ,
688
688
optimizationOperation : "SGDOptimizer" ,
689
- modelPath : model_location ,
689
+ modelPath : modelLocation ,
690
690
lossOperation : "Loss" ,
691
691
epoch : 10 ,
692
692
learningRateOperation : "SGDOptimizer/learning_rate" ,
@@ -724,16 +724,16 @@ public void TensorFlowTransformMNISTLRTrainingTest()
724
724
{
725
725
// This test changes the state of the model.
726
726
// Cleanup folder so that other test can also use the same model.
727
- CleanUp ( model_location ) ;
727
+ CleanUp ( modelLocation ) ;
728
728
}
729
729
}
730
730
731
- private void CleanUp ( string model_location )
731
+ private void CleanUp ( string modelLocation )
732
732
{
733
- var directories = Directory . GetDirectories ( model_location , "variables-*" ) ;
733
+ var directories = Directory . GetDirectories ( modelLocation , "variables-*" ) ;
734
734
if ( directories != null && directories . Length > 0 )
735
735
{
736
- var varDir = Path . Combine ( model_location , "variables" ) ;
736
+ var varDir = Path . Combine ( modelLocation , "variables" ) ;
737
737
if ( Directory . Exists ( varDir ) )
738
738
Directory . Delete ( varDir , true ) ;
739
739
Directory . Move ( directories [ 0 ] , varDir ) ;
0 commit comments