In tensorflow serving, how to store a list in feature dictionary?
up vote
0
down vote
favorite
I'm pretty new with tensorflow serving, now I'm working with client-end coding.
With the basic tutorial, I know I need to build a feature dictionary like:
feature_dict=
'input_content':tf.train.Feature(...)
'input_label':tf.train.Feature(...)
Then,
model_input=tf.train.Example(feature=tf.train.Features(feature=feature_dict))
Now, my question is, how can I put a list into the feature_dict?
Like, I have a 10 dimension list, I want to set it as the 'input_content', how can I get that?
tensorflow tensorflow-serving
add a comment |
up vote
0
down vote
favorite
I'm pretty new with tensorflow serving, now I'm working with client-end coding.
With the basic tutorial, I know I need to build a feature dictionary like:
feature_dict=
'input_content':tf.train.Feature(...)
'input_label':tf.train.Feature(...)
Then,
model_input=tf.train.Example(feature=tf.train.Features(feature=feature_dict))
Now, my question is, how can I put a list into the feature_dict?
Like, I have a 10 dimension list, I want to set it as the 'input_content', how can I get that?
tensorflow tensorflow-serving
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm pretty new with tensorflow serving, now I'm working with client-end coding.
With the basic tutorial, I know I need to build a feature dictionary like:
feature_dict=
'input_content':tf.train.Feature(...)
'input_label':tf.train.Feature(...)
Then,
model_input=tf.train.Example(feature=tf.train.Features(feature=feature_dict))
Now, my question is, how can I put a list into the feature_dict?
Like, I have a 10 dimension list, I want to set it as the 'input_content', how can I get that?
tensorflow tensorflow-serving
I'm pretty new with tensorflow serving, now I'm working with client-end coding.
With the basic tutorial, I know I need to build a feature dictionary like:
feature_dict=
'input_content':tf.train.Feature(...)
'input_label':tf.train.Feature(...)
Then,
model_input=tf.train.Example(feature=tf.train.Features(feature=feature_dict))
Now, my question is, how can I put a list into the feature_dict?
Like, I have a 10 dimension list, I want to set it as the 'input_content', how can I get that?
tensorflow tensorflow-serving
tensorflow tensorflow-serving
asked Nov 8 at 18:59
Jialong Xu
95
95
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
A tf.train.Feature
contains lists which may hold zero or more values. The lists could be of type BytesList, FloatList,
or Int64List
.
The following code adds a single float element (float_element
) to the tf.train.Feature
tf.train.Feature(float_list=tf.train.FloatList(value=[float_element]))
Notice that the float_element
is surrounded by square brackets (), i.e., a list is being created with a single element.
While trying to add a list (float_list
), one should not use square brackets like the following code snippet.
tf.train.Feature(float_list=tf.train.FloatList(value=float_list))
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
A tf.train.Feature
contains lists which may hold zero or more values. The lists could be of type BytesList, FloatList,
or Int64List
.
The following code adds a single float element (float_element
) to the tf.train.Feature
tf.train.Feature(float_list=tf.train.FloatList(value=[float_element]))
Notice that the float_element
is surrounded by square brackets (), i.e., a list is being created with a single element.
While trying to add a list (float_list
), one should not use square brackets like the following code snippet.
tf.train.Feature(float_list=tf.train.FloatList(value=float_list))
add a comment |
up vote
0
down vote
accepted
A tf.train.Feature
contains lists which may hold zero or more values. The lists could be of type BytesList, FloatList,
or Int64List
.
The following code adds a single float element (float_element
) to the tf.train.Feature
tf.train.Feature(float_list=tf.train.FloatList(value=[float_element]))
Notice that the float_element
is surrounded by square brackets (), i.e., a list is being created with a single element.
While trying to add a list (float_list
), one should not use square brackets like the following code snippet.
tf.train.Feature(float_list=tf.train.FloatList(value=float_list))
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
A tf.train.Feature
contains lists which may hold zero or more values. The lists could be of type BytesList, FloatList,
or Int64List
.
The following code adds a single float element (float_element
) to the tf.train.Feature
tf.train.Feature(float_list=tf.train.FloatList(value=[float_element]))
Notice that the float_element
is surrounded by square brackets (), i.e., a list is being created with a single element.
While trying to add a list (float_list
), one should not use square brackets like the following code snippet.
tf.train.Feature(float_list=tf.train.FloatList(value=float_list))
A tf.train.Feature
contains lists which may hold zero or more values. The lists could be of type BytesList, FloatList,
or Int64List
.
The following code adds a single float element (float_element
) to the tf.train.Feature
tf.train.Feature(float_list=tf.train.FloatList(value=[float_element]))
Notice that the float_element
is surrounded by square brackets (), i.e., a list is being created with a single element.
While trying to add a list (float_list
), one should not use square brackets like the following code snippet.
tf.train.Feature(float_list=tf.train.FloatList(value=float_list))
answered Nov 9 at 15:47
Shashank Avusali
45456
45456
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53214444%2fin-tensorflow-serving-how-to-store-a-list-in-feature-dictionary%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown