diff --git a/data/tfhub_modules.zip b/data/tfhub_modules.zip new file mode 100644 index 00000000..a61ba9c3 Binary files /dev/null and b/data/tfhub_modules.zip differ diff --git a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj b/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj index 2962902a..02f75c84 100644 --- a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj +++ b/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj @@ -8,7 +8,7 @@ 0.8.0 Haiping Chen SciSharp STACK - false + true Apache 2.0 https://github.com/SciSharp/TensorFlow.NET git @@ -49,7 +49,7 @@ Add Word2Vec example. - + diff --git a/test/TensorFlowNET.Examples/ImageProcess/RetrainImageClassifier.cs b/test/TensorFlowNET.Examples/ImageProcess/RetrainImageClassifier.cs index 6794931b..6cb7b0d2 100644 --- a/test/TensorFlowNET.Examples/ImageProcess/RetrainImageClassifier.cs +++ b/test/TensorFlowNET.Examples/ImageProcess/RetrainImageClassifier.cs @@ -25,7 +25,7 @@ namespace TensorFlowNET.Examples.ImageProcess { public int Priority => 16; - public bool Enabled { get; set; } = false; + public bool Enabled { get; set; } = true; public bool ImportGraph { get; set; } = true; public string Name => "Retrain Image Classifier"; @@ -76,14 +76,6 @@ namespace TensorFlowNET.Examples.ImageProcess wants_quantization, is_training: true); }); - /*Tensor bottleneck_tensor = graph.OperationByName("module_apply_default/hub_output/feature_vector/SpatialSqueeze"); - Tensor resized_image_tensor = graph.OperationByName("Placeholder"); - Tensor final_tensor = graph.OperationByName(final_tensor_name); - Tensor ground_truth_input = graph.OperationByName("input/GroundTruthInput"); - train_step = graph.OperationByName("train/GradientDescent"); - Tensor bottleneck_input = graph.OperationByName("input/BottleneckInputPlaceholder"); - Tensor cross_entropy = graph.OperationByName("cross_entropy/sparse_softmax_cross_entropy_loss/value");*/ - var sw = new Stopwatch(); return with(tf.Session(graph), sess => @@ -485,7 +477,7 @@ namespace TensorFlowNET.Examples.ImageProcess bottleneck_dir, jpeg_data_tensor, decoded_image_tensor, resized_input_tensor, bottleneck_tensor, module_name); how_many_bottlenecks++; - if (how_many_bottlenecks % 100 == 0) + if (how_many_bottlenecks % 300 == 0) print($"{how_many_bottlenecks} bottleneck files created."); } } @@ -609,6 +601,11 @@ namespace TensorFlowNET.Examples.ImageProcess url = "https://raw.githubusercontent.com/SciSharp/TensorFlow.NET/master/graph/InceptionV3.meta"; Web.Download(url, "graph", "InceptionV3.meta"); + // download variables.data checkpoint file. + url = "https://github.com/SciSharp/TensorFlow.NET/raw/master/data/tfhub_modules.zip"; + Web.Download(url, data_dir, "tfhub_modules.zip"); + Compress.UnZip(Path.Join(data_dir, "tfhub_modules.zip"), Path.Join(Path.GetTempPath(), "tfhub_modules")); + // Prepare necessary directories that can be used during training Directory.CreateDirectory(summaries_dir); Directory.CreateDirectory(bottleneck_dir);