I'm trying to get something very similar to the CAPTCHA example. I built and saved a very simple model in Python using the high-level Estimator API (DNNClassifier). It takes 2 floats and outputs one of two classes. I'm trying to load it in Ruby and make a prediction with it.
This fails with an ArgumentError without an error message:
2018-05-22 17:07:08.443115: I tensorflow/cc/saved_model/loader.cc:242] Loading SavedModel with tags: { serve }; from: saved_model_pb/saved_model
2018-05-22 17:07:08.447053: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA
2018-05-22 17:07:08.452575: I tensorflow/cc/saved_model/loader.cc:161] Restoring SavedModel bundle.
2018-05-22 17:07:08.453012: I tensorflow/cc/saved_model/loader.cc:171] The specified SavedModel has no variables; no checkpoints were restored.
2018-05-22 17:07:08.453024: I tensorflow/cc/saved_model/loader.cc:196] Running LegacyInitOp on SavedModel bundle.
2018-05-22 17:07:08.475575: I tensorflow/cc/saved_model/loader.cc:291] SavedModel load for tags { serve }; Status: success. Took 33095 microseconds.
rake aborted!
ArgumentError:
.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/bundler/gems/tensorflow.rb-eb3f5bf4f0fd/lib/tensorflow/session.rb:57:in `Session_run'
.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/bundler/gems/tensorflow.rb-eb3f5bf4f0fd/lib/tensorflow/session.rb:57:in `run'
lib/tasks/ml.rake:380:in `block (2 levels) in <top (required)>'
I'm trying to get something very similar to the CAPTCHA example. I built and saved a very simple model in Python using the high-level Estimator API (DNNClassifier). It takes 2 floats and outputs one of two classes. I'm trying to load it in Ruby and make a prediction with it.
I saved it using
export_saved_model
:Looking at my saved model using
saved_model_cli
shows this:My Ruby code:
This fails with an ArgumentError without an error message:
Any idea what I'm doing wrong? The CAPTCHA example and model work fine. I've attached the saved model.