docstr: load an mlmodel from disk, convert it to spec, and then convert the spec back to mlmodel
docstr_tok: ["load","an","mlmodel","from","disk",",","convert","it","to","spec",",","and","then","convert","the","spec","back","to","mlmodel"]
code: def test_path_to_mlmodel_to_spec_to_mlmodel(self):
      """
      load an mlmodel from disk, convert it to spec, and then convert the spec back to mlmodel
      """
      mlmodel_from_disk = MLModel(self.mlpackage_path)
      spec = mlmodel_from_disk.get_spec()
      mlmodel_from_spec = MLModel(
          spec, weights_dir=mlmodel_from_disk.weights_dir
      )
      self._test_mlmodel_correctness(mlmodel_from_spec)
  
imports: import os
  import shutil
  import tempfile
  import numpy
  import pytest
  import coremltools
  from coremltools import ComputeUnit, utils
  from coremltools._deps import _HAS_TORCH
  from coremltools.converters.mil import Builder
  from coremltools.libmodelpackage import ModelPackage
  from coremltools.models import MLModel
  from coremltools.models.utils import _MLPACKAGE_AUTHOR_NAME, _WEIGHTS_DIR_NAME
  from coremltools.proto import Model_pb2
label_desc: Use image node_id 5 for calling the TestSpecAndMLModelAPIs obj's underlying member method code with example usage: obj.test_path_to_mlmodel_to_spec_to_mlmodel() without return types