Browse Source

Provide the win-x64 runtime nuget for TensorFlow Gpu

The library necessary to pack the nuget can be downloaded with the
Copy-NativeTensorFlowLibs.ps1 powershell script.
tags/v0.12
Amine Chadly 6 years ago
parent
commit
0b815f0bcf
4 changed files with 75 additions and 0 deletions
  1. +13
    -0
      TensorFlow.NET.sln
  2. +21
    -0
      scripts/Copy-NativeTensorFlowLibs.ps1
  3. +1
    -0
      src/runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist/.gitignore
  4. +40
    -0
      src/runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist/runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist.csproj

+ 13
- 0
TensorFlow.NET.sln View File

@@ -22,6 +22,12 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowDatasets", "src\TensorFlowDatasets\TensorFlowDatasets.csproj", "{DF151A51-E9FD-41BD-B0F4-08A743755D44}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowDatasets", "src\TensorFlowDatasets\TensorFlowDatasets.csproj", "{DF151A51-E9FD-41BD-B0F4-08A743755D44}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Examples.GPU", "test\TensorFlowNET.Examples\TensorFlowNET.Examples.GPU.csproj", "{6F6B3382-8F87-4CD9-BF87-C81D5405685A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Examples.GPU", "test\TensorFlowNET.Examples\TensorFlowNET.Examples.GPU.csproj", "{6F6B3382-8F87-4CD9-BF87-C81D5405685A}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{EA9A238E-B93F-4809-AB3D-339B2990FBFF}"
ProjectSection(SolutionItems) = preProject
scripts\Copy-NativeTensorFlowLibs.ps1 = scripts\Copy-NativeTensorFlowLibs.ps1
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist", "src\runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist\runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist.csproj", "{BEC7FC31-58BD-48C1-96CE-6B68570A5431}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -61,6 +67,7 @@ Global
{B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Debug|Any CPU.Build.0 = Debug|Any CPU {B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Release|Any CPU.ActiveCfg = Release|Any CPU {B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Release|Any CPU.Build.0 = Release|Any CPU {B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Release|Any CPU.Build.0 = Release|Any CPU
<<<<<<< HEAD
{DF151A51-E9FD-41BD-B0F4-08A743755D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DF151A51-E9FD-41BD-B0F4-08A743755D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF151A51-E9FD-41BD-B0F4-08A743755D44}.Debug|Any CPU.Build.0 = Debug|Any CPU {DF151A51-E9FD-41BD-B0F4-08A743755D44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF151A51-E9FD-41BD-B0F4-08A743755D44}.Release|Any CPU.ActiveCfg = Release|Any CPU {DF151A51-E9FD-41BD-B0F4-08A743755D44}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -69,6 +76,12 @@ Global
{6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Debug|Any CPU.Build.0 = Debug|Any CPU {6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Release|Any CPU.ActiveCfg = Release|Any CPU {6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Release|Any CPU.Build.0 = Release|Any CPU {6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Release|Any CPU.Build.0 = Release|Any CPU
=======
{BEC7FC31-58BD-48C1-96CE-6B68570A5431}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BEC7FC31-58BD-48C1-96CE-6B68570A5431}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BEC7FC31-58BD-48C1-96CE-6B68570A5431}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BEC7FC31-58BD-48C1-96CE-6B68570A5431}.Release|Any CPU.Build.0 = Release|Any CPU
>>>>>>> Provide the win-x64 runtime nuget for TensorFlow Gpu
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE


+ 21
- 0
scripts/Copy-NativeTensorFlowLibs.ps1 View File

@@ -0,0 +1,21 @@
$targetDirectory = [IO.Path]::Combine($PSScriptRoot, "..", "src", "runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist")

$fileName = "libtensorflow-gpu-windows-x86_64-1.14.0.zip"
$zipfile = [IO.Path]::Combine($PSScriptRoot, "..", "packages", $fileName)
if (-not (Test-Path $zipfile -PathType Leaf)) {
# Create the directory just in case it's actually needed...
$path = [IO.Path]::Combine($PSScriptRoot, "..", "packages")
New-Item -Path $path -Force -ItemType Directory
Write-Host "Downloading libtensorflow gpu for Windows..."
$wc = New-Object System.Net.WebClient
$wc.DownloadFile("https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-windows-x86_64-1.14.0.zip", $zipfile)
}

$libraryName = "tensoflow.dll"
$libraryLocation = "lib\tensorflow.dll"
$windowsTensorFlow = Join-Path $targetDirectory $libraryName

if (-not (Test-Path $windowsTensorFlow))
{
& 7z e $zipfile $libraryLocation -o"$targetDirectory"
}

+ 1
- 0
src/runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist/.gitignore View File

@@ -0,0 +1 @@
tensorflow.dll

+ 40
- 0
src/runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist/runtime.win-x64.SciSharp.TensorFlow-Gpu.Redist.csproj View File

@@ -0,0 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<AssemblyName>SciSharp.Tensorflow-Gpu.Redist</AssemblyName>

<PackageId>runtime.win-x64.SciSharp.Tensorflow-Gpu.Redist</PackageId>
<Version>1.0.0</Version>
<Authors>SciSharp team</Authors>
<Company>SciSharp STACK</Company>
<RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Description>
Distribution of the windows GPU Tensoflow library.
Dll can be directly downloaded from https://storage.googleapis.com/tensorflow/libtensorflow/
</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

<PackageProjectUrl>https://github.com/SciSharp/TensorFlow.NET</PackageProjectUrl>
<PackageTags>native;tensorflow;machine-learning;ML</PackageTags>
<PackageOutputPath>../../packages</PackageOutputPath>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>

<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<ItemGroup>
<!-- All dlls will be dropped in a folder available through DllImport.-->
<Content Include="*.dll">
<PackagePath>runtimes/$(RuntimeIdentifier)/native/%(Filename)%(Extension)</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>

Loading…
Cancel
Save