Skip to content

Commit a45cc5c

Browse files
move tf meta file download to build stage (#5120)
1 parent ef3f045 commit a45cc5c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

build.proj

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
99

1010
<Import Project="build/ExternalBenchmarkDataFiles.props" />
11+
<Import Project="build/TensorflowMetaFiles.props" />
1112
<Import Project="$(ToolsDir)VersionTools.targets" Condition="Exists('$(ToolsDir)VersionTools.targets')" />
1213
<UsingTask TaskName="DownloadFilesFromUrl" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>
1314
<PropertyGroup>
@@ -36,6 +37,7 @@
3637
BuildNative;
3738
$(TraversalBuildDependsOn);
3839
DownloadExternalTestFiles;
40+
DownloadTensorflowMetaFiles;
3941
</TraversalBuildDependsOn>
4042
</PropertyGroup>
4143

@@ -95,6 +97,25 @@
9597
</DownloadFile>
9698
</Target>
9799

100+
<ItemGroup>
101+
<MetaFile Update="@(MetaFile)">
102+
<Url>https://aka.ms/mlnet-resources/%(Identity)</Url>
103+
<DestinationFile>$([System.IO.Path]::GetTempPath())/MLNET/</DestinationFile>
104+
</MetaFile>
105+
106+
<TensorflowMetaFile Include="@(MetaFile->'$([System.IO.Path]::GetTempPath())/MLNET/%(Identity)')" />
107+
</ItemGroup>
108+
109+
<Target Name="DownloadTensorflowMetaFiles" Inputs="@(TensorflowMetaFile)" Outputs="%(TensorflowMetaFile.DestinationFile)">
110+
<Message Importance="High" Text="Downloading tensorflow meta files... %(TensorflowMetaFile.DestinationFile)" />
111+
<DownloadFile
112+
SourceUrl="%(MetaFile.Url)"
113+
DestinationFolder="$([System.IO.Path]::GetTempPath())/MLNET/"
114+
Retries="5"
115+
SkipUnchangedFiles="true">
116+
</DownloadFile>
117+
</Target>
118+
98119
<Target Name="RunTests">
99120
<MSBuild Projects="test\run-tests.proj"
100121
Targets="RunTests" />

build/TensorflowMetaFiles.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
<ItemGroup>
3+
<MetaFile Include="inception_v3.meta" />
4+
<MetaFile Include="mobilenet_v2.meta" />
5+
<MetaFile Include="resnet_v2_50_299.meta" />
6+
<MetaFile Include="resnet_v2_101_299.meta" />
7+
</ItemGroup>
8+
</Project>

0 commit comments

Comments
 (0)