Search code examples
visual-studiotensorflowkerasnuget

Can't install Tensorflow.Keras : unable to resolve 'PureHDF'


I'm trying to follow this simple getting started guide for tensorflow.net and am already blocked at the first lines.

I installed TensorFlow.Net, TensorFlow.Keras and SciSharp.TensorFlow.Redist-Windows-GPU as discribed here

The code starts with

using static Tensorflow.Binding;
using static Tensorflow.KerasApi;
using Tensorflow;
using Tensorflow.NumPy;

EDIT: I didn't see that Tensorflow.keras didn't install because of an error:

Unable to resolve dependency 'PureHDF'. Source(s) used: 'nuget.org', 'Microsoft Visual Studio Offline Packages'.

In fact I can install Tensorflow.keras in a blank project, but here it's in a unity project. But I don't see wyh a nuget package shouldn't be found here and not there.


Solution

  • This is the csproj settings on my side:

    <Project Sdk="Microsoft.NET.Sdk">
    
      <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net6.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.11.0" />
        <PackageReference Include="SciSharp.TensorFlow.Redist-Windows-GPU" Version="2.10.0" />
        <PackageReference Include="TensorFlow.Keras" Version="0.10.4" />
        <PackageReference Include="TensorFlow.NET" Version="0.100.4" />
      </ItemGroup>
    
    </Project>
    

    And above dependencies work fine:

    enter image description here

    I think the KeraApi should comes from TensorFlow.NET package, and the issue should comes from packages incompatible or dependencies was not been totally loaded.