Skip to content

Be flexible on Content-Type when loading model weights/topology #1188

Closed
tensorflow/tfjs-core
#1532
@dsmilkov

Description

@dsmilkov

tensorflow/tfjs-core#1455 introduced an unnecessary strict Content-Type check that broke several users (and use-cases).

We should not be strict about the Content-Type and ONLY report it to the user IF we fail to parse the weight/topology in order to help them debug the issue.

Broken use-cases include:

  • A server that was serving the weights with Content-Type text/html and the user is in no control of the content-type.
  • Our Keras models on GCP (e.g. MobileNet 1.0 224) serve model.json as application/octet-stream, however we fail because we expect application/json.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions