google / model_search

Apache License 2.0
3.26k stars 462 forks source link

How to predict from model_search saved_model.pb #58

Open jayarams79 opened 3 years ago

jayarams79 commented 3 years ago

Hi, I have tried simple classification dataset "German credit data" to make predictions. I load the model_search saved_model.pb model. importedModel = tf.saved_model.load(saved_model_dir)

But, when I try to predict or make summary() from the model ,I get the following error,

AttributeError: 'AutoTrackable' object has no attribute 'summary'

When I print print (gs_model.signatures), I got "['serving_default']".

How can I predict, get metrics like f1_score, accuracy, R2,etc from the model.

Is it possible to store the model_search model as tenorflow v2 compatible in oss_trainer_lib.py instead of "estimator"model.

Pls suggest on this. I am using tensorflow 2.4.0 How can I make the model to work like keras model.

Thanks, SJRam

CyFeng16 commented 3 years ago

*.pd -> *.onnx -> WYW I hope it work for you guy's too.

jayarams79 commented 3 years ago

*.pd -> *.onnx -> WYW I hope it work for you guy's too.

Hi, is it mean that I need to convert .pb file to onnx and then to WYW. What is the mean for "WYW". Any link for solution of same issue.

CyFeng16 commented 3 years ago

Hi dude, WYW stands for whatever you want, so sorry for the confusing abbreviation. ONNX is widely supported http://onnx.ai/supported-tools and can be found in many frameworks, tools, and hardware. ref onnx and onnxruntime

jayarams79 @.***> 于2021年5月17日周一 下午8:26写道:

.pd -> .onnx -> WYW I hope it work for you guy's too.

Hi, is it mean that I need to convert .pb file to onnx and then to WYW. What is the mean for "WYW". Any link for solution of same issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/model_search/issues/58#issuecomment-842283309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDIKHNIOQAWQXNBY52WJG3TOEDQ5ANCNFSM45AFR3YA .