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

load model

Open apicquot opened this issue 5 years ago • 11 comments

I apologize in advance for asking a question there but I could not find any blog to do so

I am creating a Keras model in Python and would like to load and use it. Unfortunately the load_model is not implemented, any turn around ? I am using keras installed with Tensorflow, I do not have Keras installed.

net = tf.keras.models.load_model(net_name)
res = net.predict(sample)

apicquot avatar Jul 08 '20 13:07 apicquot

Hi! I have the same issue. I train models in python with tensorflow 2.3.0 that I would like to load and use in c#. Is it possible with the current version of TensorFlow.NET? If not, will it be in the future? Thank you for your great work!

glennuggah avatar Aug 20 '20 09:08 glennuggah

How do people normally use Tensorflow.NET if they can't load models? Do they only do inference after training? Or do they just load the weights?

patrickmurray18 avatar Dec 15 '20 05:12 patrickmurray18

@patrickmurray18 It's working in progress. Not completed yet.

Oceania2018 avatar Dec 15 '20 15:12 Oceania2018

Related to #554

Oceania2018 avatar Jan 10 '21 18:01 Oceania2018

@Oceania2018 Could you elaborate on what is the status on this issue? Is it in the plans to implement this feature?

As far as i can see it seems pretty impossible to use models trained in tf2.2 or later with this framework atm. Or am I missing something?

Thanks,

jptrxff avatar May 26 '21 13:05 jptrxff

@jptrxff You could use model.load_weights as an option.

Oceania2018 avatar May 26 '21 14:05 Oceania2018

@jptrxff You could use model.load_weights as an option.

Thanks for your reply, but as far as I can see then I would need to specify my model in C# right? My main issue is that my model definition and training are done in python. Thus I am looking for a way of running inference in C# for the model trained in python. (This has btw worked quite good for tensorflow 1.x, so thanks for the good work)

jptrxff avatar May 26 '21 15:05 jptrxff

Hello Model created in Python, Tensorflow 2.4 saved in pb and their variables not hd5 with model.save() How I can load it and run inference? Many thanks

sportbilly21 avatar Jul 02 '21 12:07 sportbilly21

So many months already... I'm facing the same issue. BTW, thanks.

jinfeei avatar Apr 03 '22 16:04 jinfeei

So many years, I'm facing the same issue

axel578 avatar Jun 17 '22 15:06 axel578

Is anybody interested in dropping bounty for this task. Bountysource is the funding platform for open-source software. Users can improve the open-source projects they love by creating/collecting bounties and pledging to fundraisers. https://bountysource.com/

Esther2013 avatar Jun 17 '22 15:06 Esther2013

The loading of model has been supported after v0.100.4. I feel sorry for the inconvenience. tf.net has long been in short of hands and even myself began to join and maintain this repo only several months ago. Thanks for all your support for tf.net! If there's any problem in the future, please open a new issue and I'll help with that. :)

SanftMonster avatar May 23 '23 13:05 SanftMonster