code: def eval_and_write(
      model_file, node_name, output_file, minibatch_source, num_objects
  ):
      # load model and pick desired node as output
      loaded_model = load_model(model_file)
      node_in_graph = loaded_model.find_by_name(node_name)
      output_nodes = combine([node_in_graph.owner])
  
      # evaluate model and get desired node output
      print("Evaluating model for output node %s" % node_name)
      features_si = minibatch_source["features"]
      with open(output_file, "wb") as results_file:
          for i in range(0, num_objects):
              mb = minibatch_source.next_minibatch(1)
              output = output_nodes.eval(mb[features_si])
  
              # write results to file
              out_values = output[0].flatten()
              np.savetxt(
                  results_file, out_values[np.newaxis], fmt="%.6f"
              )
  
file_path: CNTK/Examples/Image/FeatureExtraction/FeatureExtraction.py
imports: from __future__ import print_function
  import os
  import numpy
  import cntk
  from cntk import load_model, combine
  import cntk.io.transforms
  from cntk.logging import graph
  from cntk.logging.graph import get_node_outputs
label_desc: Use image node_id 2 for calling a global function with example usage: eval_and_write(model_file, node_name, output_file, minibatch_source, num_objects) without return types