Upgrading python program to use tensorflow 2 models in keras 2.4

Viewed 30

I am using keras 2.4 and have the following code:

import keras.models

model_path = path\tf1_model.model
json_path = path\tf1_model.json

m = keras.models.load_model(str(model_path))

This works just fine. But I want to upgrade to use tensorflow 2 models. My research has said that for the model path, I have to point to where the TF2 model folder is now that contains the .pb file, the assets folder, and the variable folder instead of any given file such as the .pb file.

When I try this, I get the error

Cannot find C:\Users\722208\Desktop\Models\WPC_Ox_TF2_112421_Segnet_1_serving_model 

though I do know that it can see the folder, because I tried to point it to the .pb file and the program sees it but fails on loading it.

Am I just going about this all wrong?

0 Answers
Related