LiorBanai / HDF5-CSharp

C# wrapper for windows/Linux systems for reading and writing H5 files
MIT License
54 stars 27 forks source link

H5f threw exception #313

Open Marco-Pellegrino opened 1 year ago

Marco-Pellegrino commented 1 year ago

Hi @LiorBanai !

I am facing an issue while trying to run the code on my M2 machine.

Does it suppose to work? Any tip?

Screenshot 2023-07-18 at 19 57 04 Screenshot 2023-07-17 at 00 04 41

recorder.mpco.zip

LiorBanai commented 1 year ago

Hi @Marco-Pellegrino looking at the HDF.PInvoke supported frameworks it should work https://www.nuget.org/packages/HDF.PInvoke.1.10/ are you compiling it in AnyCPU or x64/32. Since it is native AnyCPU won't work..

LiorBanai commented 1 year ago

Can you run any of the unit tests in x64 and see if they work?

Marco-Pellegrino commented 1 year ago

it looks like that I will need to struggle a little bit :) Not sure I have the expertise to solve the issue but I will try.

I will keep you posted

Marco-Pellegrino commented 1 year ago

Interestin fact.

PureHDF run without any problem

LiorBanai commented 1 year ago

PureHDF has no dependency on Pinvoke C++. If you only need reading then PureHDF is the library to go with :)

Marco-Pellegrino commented 1 year ago

Yes. I only need to read the data.

Looks like that I will need to learn a little bit PureHDF and convert some of my previous code.

Thanks a lot @LiorBanai :)

Sahasrara commented 3 months ago

I'm having the same issue. I'm trying to use Tensorflow.NET in Unity and getting this error:

DllNotFoundException: hdf5 assembly:<unknown assembly> type:<unknown type> member:(null)
HDF.PInvoke.H5F..cctor () (at /home/appveyor/projects/hdf-pinvoke-1-10/submodules/HDF.PInvoke/HDF5/H5Fpublic.cs:41)
Rethrow as TypeInitializationException: The type initializer for 'HDF.PInvoke.H5F' threw an exception.
HDF5CSharp.Hdf5.OpenFile (System.String filename, System.Boolean readOnly, System.Boolean attemptShortPath) (at <a573135056b64eceaab6f7dd4003494c>:0)
Tensorflow.Keras.Engine.Model.load_weights (System.String filepath, System.Boolean by_name, System.Boolean skip_mismatch, System.Object options) (at <3504e8007fee496baf2c8fdd9578867a>:0)
Slay.Crepe.BuildAndLoadModel (Slay.Crepe+ModelCapacity capacity) (at Assets/Scripts/Sound/AI/Crepe.cs:78)
Slay.Crepe.Start () (at Assets/Scripts/Sound/AI/Crepe.cs:13)

Any idea what I might be doing wrong? Here's what NugetForUnity pulled in:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Fody" version="6.7.0" />
  <package id="Google.Protobuf" version="3.21.12" />
  <package id="HDF.PInvoke.1.10" version="1.10.612" />
  <package id="HDF5-CSharp" version="1.19.0" />
  <package id="MethodBoundaryAspect.Fody" version="2.0.149" />
  <package id="Microsoft.Build.Framework" version="17.10.4" />
  <package id="Microsoft.Build.Utilities.Core" version="17.10.4" manuallyInstalled="true" />
  <package id="Microsoft.IO.Redist" version="6.0.0" manuallyInstalled="true" />
  <package id="Microsoft.NET.StringTools" version="17.10.4" />
  <package id="Microsoft.Win32.Registry" version="5.0.0" />
  <package id="Newtonsoft.Json" version="13.0.3" />
  <package id="OneOf" version="3.0.263" />
  <package id="Protobuf.Text" version="0.7.2" />
  <package id="PureHDF" version="1.0.0-beta.2" />
  <package id="Razorvine.Pickle" version="1.4.0" />
  <package id="Serilog" version="2.10.0" />
  <package id="Serilog.Sinks.Console" version="4.1.0" />
  <package id="SharpZipLib" version="1.4.2" />
  <package id="System.Collections.Immutable" version="8.0.0" />
  <package id="System.Configuration.ConfigurationManager" version="8.0.0" />
  <package id="System.Resources.Extensions" version="7.0.0" />
  <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" />
  <package id="System.Security.AccessControl" version="6.0.0" />
  <package id="System.Security.Cryptography.ProtectedData" version="8.0.0" />
  <package id="System.Security.Permissions" version="8.0.0" manuallyInstalled="true" />
  <package id="System.Security.Principal.Windows" version="5.0.0" />
  <package id="System.Text.Encoding.CodePages" version="7.0.0" />
  <package id="TensorFlow.Keras" version="0.15.0" manuallyInstalled="true" />
  <package id="TensorFlow.NET" version="0.150.0" manuallyInstalled="true" />
</packages>