Browse Source

add variables.data file.

tags/v0.9
Oceania2018 6 years ago
parent
commit
4bf27bd310
3 changed files with 9 additions and 12 deletions
  1. BIN
      data/tfhub_modules.zip
  2. +2
    -2
      src/TensorFlowNET.Core/TensorFlowNET.Core.csproj
  3. +7
    -10
      test/TensorFlowNET.Examples/ImageProcess/RetrainImageClassifier.cs

BIN
data/tfhub_modules.zip View File


+ 2
- 2
src/TensorFlowNET.Core/TensorFlowNET.Core.csproj View File

@@ -8,7 +8,7 @@
<Version>0.8.0</Version>
<Authors>Haiping Chen</Authors>
<Company>SciSharp STACK</Company>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Copyright>Apache 2.0</Copyright>
<RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
@@ -49,7 +49,7 @@ Add Word2Vec example.</PackageReleaseNotes>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.7.0" />
<PackageReference Include="NumSharp" Version="0.10.1" />
<PackageReference Include="NumSharp" Version="0.10.2" />
</ItemGroup>

<ItemGroup>


+ 7
- 10
test/TensorFlowNET.Examples/ImageProcess/RetrainImageClassifier.cs View File

@@ -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);


Loading…
Cancel
Save