Skip to content

Commit 4bf27bd

Browse files
committed
add variables.data file.
1 parent a9330d2 commit 4bf27bd

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

data/tfhub_modules.zip

77.4 MB
Binary file not shown.

src/TensorFlowNET.Core/TensorFlowNET.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Version>0.8.0</Version>
99
<Authors>Haiping Chen</Authors>
1010
<Company>SciSharp STACK</Company>
11-
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
11+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1212
<Copyright>Apache 2.0</Copyright>
1313
<RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
@@ -49,7 +49,7 @@ Add Word2Vec example.</PackageReleaseNotes>
4949

5050
<ItemGroup>
5151
<PackageReference Include="Google.Protobuf" Version="3.7.0" />
52-
<PackageReference Include="NumSharp" Version="0.10.1" />
52+
<PackageReference Include="NumSharp" Version="0.10.2" />
5353
</ItemGroup>
5454

5555
<ItemGroup>

test/TensorFlowNET.Examples/ImageProcess/RetrainImageClassifier.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)