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

Fix missing null termination in tag list when loading a saved model #108

Merged
merged 1 commit into from Aug 17, 2018

Conversation

Projects
None yet
2 participants
@WGautier
Copy link
Contributor

WGautier commented Aug 16, 2018

On one of our servers, we were seeing this behaviour:

2018-08-16 16:11:32.549690: I tensorflow/cc/saved_model/loader.cc:233] SavedModel load for tags { serve  }; Status: fail. Took 1261 microseconds.

Notice the extra space after 'serve'. This extra space was actually garbage data from Tensorflow converting the tag list from an array of chars, without null termination, to a string.

Using c_str() creates a correctly null-terminated array of chars and fixes the problem.

As a bonus, though my C++ is rusty, I believe this removes the need for the memory allocation/destruction with new.

@Arafatk

This comment has been minimized.

Copy link
Collaborator

Arafatk commented Aug 17, 2018

@WGautier Thanks a lot for doing this.

@Arafatk Arafatk merged commit 1adf4fe into somaticio:master Aug 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment