@@ -25,7 +25,7 @@ public class RetrainImageClassifier : IExample
2525 {
2626 public int Priority => 16 ;
2727
28- public bool Enabled { get ; set ; } = false ;
28+ public bool Enabled { get ; set ; } = true ;
2929 public bool ImportGraph { get ; set ; } = true ;
3030
3131 public string Name => "Retrain Image Classifier" ;
@@ -76,14 +76,6 @@ public bool Run()
7676 wants_quantization , is_training : true ) ;
7777 } ) ;
7878
79- /*Tensor bottleneck_tensor = graph.OperationByName("module_apply_default/hub_output/feature_vector/SpatialSqueeze");
80- Tensor resized_image_tensor = graph.OperationByName("Placeholder");
81- Tensor final_tensor = graph.OperationByName(final_tensor_name);
82- Tensor ground_truth_input = graph.OperationByName("input/GroundTruthInput");
83- train_step = graph.OperationByName("train/GradientDescent");
84- Tensor bottleneck_input = graph.OperationByName("input/BottleneckInputPlaceholder");
85- Tensor cross_entropy = graph.OperationByName("cross_entropy/sparse_softmax_cross_entropy_loss/value");*/
86-
8779 var sw = new Stopwatch ( ) ;
8880
8981 return with ( tf . Session ( graph ) , sess =>
@@ -485,7 +477,7 @@ private void cache_bottlenecks(Session sess, Dictionary<string, Dictionary<strin
485477 bottleneck_dir , jpeg_data_tensor , decoded_image_tensor ,
486478 resized_input_tensor , bottleneck_tensor , module_name ) ;
487479 how_many_bottlenecks ++ ;
488- if ( how_many_bottlenecks % 100 == 0 )
480+ if ( how_many_bottlenecks % 300 == 0 )
489481 print ( $ "{ how_many_bottlenecks } bottleneck files created.") ;
490482 }
491483 }
@@ -609,6 +601,11 @@ public void PrepareData()
609601 url = "https://raw.githubusercontent.com/SciSharp/TensorFlow.NET/master/graph/InceptionV3.meta" ;
610602 Web . Download ( url , "graph" , "InceptionV3.meta" ) ;
611603
604+ // download variables.data checkpoint file.
605+ url = "https://github.com/SciSharp/TensorFlow.NET/raw/master/data/tfhub_modules.zip" ;
606+ Web . Download ( url , data_dir , "tfhub_modules.zip" ) ;
607+ Compress . UnZip ( Path . Join ( data_dir , "tfhub_modules.zip" ) , Path . Join ( Path . GetTempPath ( ) , "tfhub_modules" ) ) ;
608+
612609 // Prepare necessary directories that can be used during training
613610 Directory . CreateDirectory ( summaries_dir ) ;
614611 Directory . CreateDirectory ( bottleneck_dir ) ;
0 commit comments