rstudio / tfdeploy

tfdeploy: Deploy Tensorflow Models from R
https://tensorflow.rstudio.com/tools/tfdeploy/
23 stars 12 forks source link

Error while trying to reproduce "Getting Started" example. #31

Open jcrodriguez1989 opened 5 years ago

jcrodriguez1989 commented 5 years ago

I am not being able to reproduce the example given in TensorFlow Model Deployment from R End-to-End section.

I am willing to export and then serve a keras model, however, when I have my model ready (after predicting) I get:

library(tfdeploy)
export_savedmodel(model, "savedmodel")
## Error in export_savedmodel.keras.engine.training.Model(model, "savedmodel") : 
##   'export_savedmodel()' is currently unsupported under the TensorFlow Keras implementation, consider using 'tfestimators::keras_model_to_estimator()'.

So I tried using tfestimators::keras_model_to_estimator, however, I am still having issues:

tfe_model <- tfestimators::keras_model_to_estimator(model)
export_savedmodel(tfe_model, "savedmodel")
## Error in export_savedmodel.tf_estimator(tfe_model, "savedmodel") : 
##   Currently only classifier and regressor are supported. Please specify a custom serving_input_receiver_fn.

Is there anything I am missing? My sessionInfo()

thanks! Juan Cruz

RajatChaudhary1992 commented 5 years ago

I am also getting the same issue

ashishsr123 commented 5 years ago

I have same issue , using Rstudio on Google Cloud Platform