code: def main(args):
      if args.model_dir.startswith("s3://"):
          os.environ["S3_REGION"] = "us-west-2"
          os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1"
          os.environ["S3_USE_HTTPS"] = "1"
  
      train_data, train_labels = _load_training_data(args.train)
      eval_data, eval_labels = _load_testing_data(args.train)
  
      # Create the Estimator
      mnist_classifier = tf.estimator.Estimator(
          model_fn=cnn_model_fn, model_dir=args.model_dir
      )
  
      # Set up logging for predictions
      # Log the values in the "Softmax" tensor with label "probabilities"
      tensors_to_log = {"probabilities": "softmax_tensor"}
      logging_hook = tf.estimator.LoggingTensorHook(
          tensors=tensors_to_log, every_n_iter=50
      )
  
      # Train the model
      train_input_fn = tf.compat.v1.estimator.inputs.numpy_input_fn(
          x={"x": train_data},
          y=train_labels,
          batch_size=50,
          num_epochs=None,
          shuffle=False,
      )
  
      # Evaluate the model and print results
      eval_input_fn = tf.compat.v1.estimator.inputs.numpy_input_fn(
          x={"x": eval_data}, y=eval_labels, num_epochs=1, shuffle=False
      )
  
      train_spec = tf.estimator.TrainSpec(
          train_input_fn, max_steps=1000
      )
      eval_spec = tf.estimator.EvalSpec(eval_input_fn)
      tf.estimator.train_and_evaluate(
          mnist_classifier, train_spec, eval_spec
      )
  
      if args.current_host == args.hosts[0]:
          mnist_classifier.export_saved_model(
              "/opt/ml/model", serving_input_fn
          )
  
file_path: sagemaker-python-sdk/tests/data/tensorflow_mnist/mnist_v1.py
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import json
  import numpy
  import os
  import tensorflow
label_desc: Use image node_id 6 for calling a global function with example usage: main(args) without return types