Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b437488

Browse filesBrowse files
authored
Coerce string to bytes in py2-3 compat way (GoogleCloudPlatform#867)
1 parent 4ebd4c3 commit b437488
Copy full SHA for b437488

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎ml_engine/online_prediction/predict.py

Copy file name to clipboardExpand all lines: ml_engine/online_prediction/predict.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def census_to_example_bytes(json_instance):
122122
for key, data in six.iteritems(json_instance):
123123
if isinstance(data, six.string_types):
124124
feature_dict[key] = tf.train.Feature(
125-
bytes_list=tf.train.BytesList(value=[str(data)]))
125+
bytes_list=tf.train.BytesList(value=[data.encode('utf-8')]))
126126
elif isinstance(data, float):
127127
feature_dict[key] = tf.train.Feature(
128128
float_list=tf.train.FloatList(value=[data]))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.