code: def save_model_to_proto(net_def, model_name, output_dir):
      output_path = output_dir + "/" + model_name + ".pb"
      with open(output_path, "wb") as f:
          f.write(net_def.SerializeToString())
      with open(output_path + "_txt", "w") as f:
          f.write(str(net_def))
      return output_path
  
imports: import argparse
  import copy
  import os
  import sh
  import yaml
  from py_proto import mace_pb2
  from transform.base_converter import ConverterUtil
  from transform.base_converter import MaceKeyword
  from transform.base_converter import MaceOp
  from transform.hexagon_converter import HexagonOp
  from utils.config_parser import DataFormat
  from utils.config_parser import ModelKeys
  from utils.util import mace_check
label_desc: Use image node_id 2 for calling a global function with example usage: save_model_to_proto(net_def, model_name, output_dir) and returns: output_path