async function loadGraphModel(modelUrl, options = {}) {
      if (modelUrl == null) {
          throw new Error('modelUrl in loadGraphModel() cannot be null. Please provide a url ' +
              'or an IOHandler that loads the model');
      }
      if (options == null) {
          options = {};
      }
      if (options.fromTFHub) {
          if (modelUrl.load == null) {
              if (!modelUrl.endsWith('/')) {
                  modelUrl = modelUrl + '/';
              }
              modelUrl = `${modelUrl}${DEFAULT_MODEL_NAME}${TFHUB_SEARCH_PARAM}`;
          }
      }
      const model = new GraphModel(modelUrl, options);
      await model.load();
      return model;
  }
/**
   * Load a graph model given a URL to the model definition.
   *
   * Example of loading MobileNetV2 from a URL and making a prediction with a
   * zeros input:
   *
   * ```js
   * const modelUrl =
   *    'https://storage.googleapis.com/tfjs-models/savedmodel/mobilenet_v2_1.0_224/model.json';
   * const model = await tf.loadGraphModel(modelUrl);
   * const zeros = tf.zeros([1, 224, 224, 3]);
   * model.predict(zeros).print();
   * ```
   *
   * Example of loading MobileNetV2 from a TF Hub URL and making a prediction with
   * a zeros input:
   *
   * ```js
   * const modelUrl =
   *    'https://tfhub.dev/google/imagenet/mobilenet_v2_140_224/classification/2';
   * const model = await tf.loadGraphModel(modelUrl, {fromTFHub: true});
   * const zeros = tf.zeros([1, 224, 224, 3]);
   * model.predict(zeros).print();
   * ```
   * @param modelUrl The url or an `io.IOHandler` that loads the model.
   * @param options Options for the HTTP request, which allows to send credentials
   *    and custom headers.
   *
   * @doc {heading: 'Models', subheading: 'Loading'}
   */
Load a graph model given a URL to the model definition.
Example of loading MobileNetV2 from a URL and making a prediction with a
zeros input.



Example of loading MobileNetV2 from a TF Hub URL and making a prediction with
a zeros input.



@doc {heading: 'Models', subheading: 'Loading'}
Load a graph model given a URL to the model definition . Example of loading MobileNetV2 from a URL and making a prediction with a zeros input . Example of loading MobileNetV2 from a TF Hub URL and making a prediction with a zeros input . @doc { heading : ' Models ' subheading : ' Loading ' }
async function loadGraphModel(modelUrl, options = {}) {
      if (modelUrl == null) {
          throw new Error('modelUrl in loadGraphModel() cannot be null. Please provide a url ' +
              'or an IOHandler that loads the model');
      }
      if (options == null) {
          options = {};
      }
      if (options.fromTFHub) {
          if (modelUrl.load == null) {
              if (!modelUrl.endsWith('/')) {
                  modelUrl = modelUrl + '/';
              }
              modelUrl = `${modelUrl}${DEFAULT_MODEL_NAME}${TFHUB_SEARCH_PARAM}`;
          }
      }
      const model = new GraphModel(modelUrl, options);
      await model.load();
      return model;
  }
async function loadGraphModel ( modelUrl , options = { } ) { if ( modelUrl == null ) { throw new Error ( 'modelUrl in loadGraphModel() cannot be null. Please provide a url ' + 'or an IOHandler that loads the model' ) ; } if ( options == null ) { options = { } ; } if ( options . fromTFHub ) { if ( modelUrl . load == null ) { if ( ! modelUrl . endsWith ( '/' ) ) { modelUrl = modelUrl + '/' ; } modelUrl = ` ${ modelUrl } ${ DEFAULT_MODEL_NAME } ${ TFHUB_SEARCH_PARAM } ` ; } } const model = new GraphModel ( modelUrl , options ) ; await model . load ( ) ; return model ; }
Load a graph model given a URL to the model definition.
Load a graph model given a URL to the model definition .