serving: TensorFlow Serving "version_labels" do not work as documented for the HTTP REST API

Bug Report

System information

  • OS Platform and Distribution: Windows 10 and Linux Ubuntu 18.04 in WSL
  • TensorFlow Serving installed from: Docker image (binary)
  • TensorFlow Serving version: Docker image tensorflow/serving:latest (downloaded around January 20th)

Describe the problem

At a high level, the version_labels feature appears not to work correctly. (This feature is illustrated with the “canary” vs “stable” version labels example in the TensorFlow documentation).

More specifically, it may only work with simple numeric version labels.

The following URL will be rejected by TensorFlow Serving: host/v1/models/my_model/versions/1.0:predict with a Malformed request... error.

Exact Steps to Reproduce

I believe that any kind of non-numeric version label will fail. (i.e. The “canary” vs “stable” example itself should fail.)

Source code / logs

http_rest_api_handler.cc seems to define a regular expression used to parse the URL. Note that, after “versions”, the regular expression defines an expectation for a numeric version.

prediction_api_regex_(
          R"((?i)/v1/models/([^/:]+)(?:/versions/(\d+))?:(classify|regress|predict))")

It’s possible that I misread the code, but this interpretation agrees with an observation on StackOverflow that numeric versions are handled correctly whereas text version labels are not.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Just a note that I have a preliminary implementation for the awesome idea @christisg mentioned and will resume with testing and merging it once we get some of our build breakage (due to incompatibilities with recent changes in upstream TF) under control.