Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensor example support #71

Open
KwansuKim opened this issue Jul 1, 2022 · 6 comments
Open

tensor example support #71

KwansuKim opened this issue Jul 1, 2022 · 6 comments

Comments

@KwansuKim
Copy link

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?

@galeone
Copy link
Owner

galeone commented Jul 1, 2022

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?

@galeone
Copy link
Owner

galeone commented Jul 1, 2022

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 132f4f1

You must use a SavedModel and feed the tensors using tf.NewTensor as shown in the readme

@KwansuKim
Copy link
Author

Thanks for quick answer! I'm gonna try it according to your comment.

@KwansuKim
Copy link
Author

@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

@galeone
Copy link
Owner

galeone commented Jul 1, 2022

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

@KwansuKim
Copy link
Author

@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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants