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.
On one of our servers, we were seeing this behaviour:
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
.