TensorFlow.NET icon indicating copy to clipboard operation
TensorFlow.NET copied to clipboard

Keras model.load_weights() gives FileLoadException for HDF5CSharp.dll

Open horseathesource opened this issue 3 years ago • 3 comments

There is an issue with a call from load_weights to HDF5CSharp.dll. This is the error I get:

System.IO.FileLoadException: 'Could not load file or assembly 'HDF5CSharp, Version=1.12.5.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)'

HDF5CSharp is installed, and even updated to 1.12.7.0. The dll is in the correct path. Any idea?

horseathesource avatar Mar 01 '22 16:03 horseathesource

When I use 'save_weights', I got the same error as yours, is there a solution?

ZIWaters avatar Apr 11 '22 06:04 ZIWaters

I also meet this problem,but when I use net.core3.1,could success save and save_weight.

zhangjiechina001 avatar Jul 12 '22 07:07 zhangjiechina001

Did you find a solution?

codingyoutub avatar Sep 12 '22 17:09 codingyoutub

save can use in net.core3.1. Save and save_weight can't work on .net frameworks

lionwu avatar Nov 23 '22 08:11 lionwu

@lionwu Can you help check if the HDF5-CSharp works in your side?

Oceania2018 avatar Nov 23 '22 16:11 Oceania2018

@Oceania2018 no, still the same msg "System.IO.FileLoadException: 'Could not load file or assembly 'HDF5CSharp, Version=1.12.5.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required." in .NetFramework 4.8. But it's work on net.core3.1. I am update HDF5CSharp to 1.16.2

lionwu avatar Nov 24 '22 02:11 lionwu

The save issue has been resolved, but load_model is still not working

codingyoutub avatar Nov 24 '22 09:11 codingyoutub