code: def test_convert_from_saved_model_dir(tmpdir):
      # Sample input
      test_input = np.random.rand(1, 3, 5) - 0.5
  
      # create the model to convert
      import tensorflow as tf
  
      with tf.compat.v1.Session() as sess:
          x = tf.placeholder(shape=(1, 3, 5), dtype=tf.float32)
          y = tf.nn.relu(x)
  
          expected_val = sess.run(y, feed_dict={x: test_input})
  
      # Save model as SavedModel
      inputs = {"x": x}
      outputs = {"y": y}
      save_path = str(tmpdir)
      tf.compat.v1.saved_model.simple_save(
          sess, save_path, inputs, outputs
      )
  
      # SavedModel directory generated by TensorFlow 1.x
      # when converting from SavedModel dir, inputs / outputs are optional
      mlmodel = ct.convert(save_path)
  
      # Need input output names to call mlmodel
      # x.name == 'Placeholder:0'. Strip out ':0'
      input_name = x.name.split(":")[0]
      results = mlmodel.predict({input_name: test_input})
      # y.name == 'Relu:0'. output_name == 'Relu'
      output_name = y.name.split(":")[0]
      np.testing.assert_allclose(results[output_name], expected_val)
  
imports: from os import getcwd, chdir
  from shutil import rmtree
  from os.path import exists
  from tempfile import mkdtemp
  import pytest
  import numpy
  import coremltools
  import os
  from coremltools._deps import _HAS_TF_1, _HAS_TF_2, _HAS_TORCH, MSG_TF1_NOT_FOUND, MSG_TF2_NOT_FOUND, MSG_TORCH_NOT_FOUND
label_desc: Use image node_id 3 for calling the TestTensorFlow1ConverterExamples obj's underlying member method code with example usage: obj.test_convert_from_saved_model_dir(tmpdir) without return types