Loads a ModuleSpec from a TF Hub service or the filesystem.


path string describing the location of a module. There are several supported path encoding schemes: a) A URL like "" referring to or another service implementing b) A URL like "" that points to a compressed tarball directly, as long as that web server ignores the query parameters added by c) Any filesystem location of a module directory (e.g. /module_dir for a local filesystem). All filesystems implementations provided by Tensorflow are supported. d) Private name resolution schemes added by the maintainer of your local installation of the tensorflow_hub library (usually none).

A ModuleSpec.

ValueError on unexpected values in the module spec.
tf.errors.OpError on file handling exceptions.