tfgo
tfgo copied to clipboard
tensor example support
It seems that it is not possible to use "github.com/galeone/tfgo/proto/example" from tfgo v2.9. Are there any available ways to use example.Features and example.Example in tfgo v2.9? Or could you let me know another way to feed saved models without them?
Isn't possible to use tf.NewTensor and feed it as input to the saved model?
I do this in the example you can see in the README.
Is this the thing you are looking for or do I misunderstand your question?
Now that I'm thinking about the proto/example thing clearly, I remember that I explicitly removed (a long time ago!) that part, because it's tensorflow itself that only supports SavedModels and the proto/example was there for feeding the estimators/frozen models. That type of model is not supported anymore by TensorFlow and therefore I removed them in this commit https://github.com/galeone/tfgo/commit/132f4f1c5dd7c604814ef7261fe40d3510e01220
You must use a SavedModel and feed the tensors using tf.NewTensor as shown in the readme
Thanks for quick answer! I'm gonna try it according to your comment.
@galeone Could you help me to resolve the below build issue?
go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/framework/types_go_proto go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto serving/ml/tensorflow imports github.com/galeone/tfgo imports github.com/tensorflow/tensorflow/tensorflow/go imports github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto: module github.com/tensorflow/tensorflow@latest found (v2.9.1+incompatible), but does not contain package github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto serving/ml/tensorflow imports github.com/galeone/tfgo imports github.com/tensorflow/tensorflow/tensorflow/go tested by github.com/tensorflow/tensorflow/tensorflow/go.test imports github.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto: module github.com/tensorflow/tensorflow@latest found (v2.9.1+incompatible), but does not contain package github.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto serving/ml/tensorflow imports github.com/galeone/tfgo imports github.com/tensorflow/tensorflow/tensorflow/go tested by github.com/tensorflow/tensorflow/tensorflow/go.test imports github.com/tensorflow/tensorflow/tensorflow/go/core/framework/types_go_proto: module github.com/tensorflow/tensorflow@latest found (v2.9.1+incompatible), but does not contain package github.com/tensorflow/tensorflow/tensorflow/go/core/framework/types_go_proto
You're using tensorflow, the official package - it's broken. You must use the fork I maintain instead:
github.com/galeone/tensorflow/tensorflow/go
As you can see the tf package in the example, comes from this package, not from the official one
@galeone How can I make a tensor to input a model in case a model's input values involve different types like string, float32 at the same time? The following feature list is a sample I'd like to implement. With tensor.example, it would be possible to do it but now I'm not sure how to do it without tensor.example. "feature_a": "string_1" "feature_b": "string_2" "feature_c": 34.23 "feature_d": [1.0, 2.0, 3.0, 4.0]