Guest User

Untitled

a guest
Jan 24th, 2020
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ValueError Traceback (most recent call last)
  2. <ipython-input-59-dd135cdcecbf> in <module>
  3. ----> 1 loaded_model = mlflow.pyfunc.load_model('runs:/{0}/Model'.format(run_id))
  4.  
  5. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\mlflow\pyfunc\__init__.py in load_model(model_uri, suppress_warnings)
  6. 290 mlflow.pyfunc.utils._add_code_to_system_path(code_path=code_path)
  7. 291 data_path = os.path.join(local_model_path, conf[DATA]) if (DATA in conf) else local_model_path
  8. --> 292 return importlib.import_module(conf[MAIN])._load_pyfunc(data_path)
  9. 293
  10. 294
  11.  
  12. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\mlflow\pyfunc\model.py in _load_pyfunc(model_path)
  13. 212 "Python model path was not specified in the model configuration")
  14. 213 with open(os.path.join(model_path, python_model_subpath), "rb") as f:
  15. --> 214 python_model = cloudpickle.load(f)
  16. 215
  17. 216 artifacts = {}
  18.  
  19. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\engine\network.py in __setstate__(self, state)
  20. 1332
  21. 1333 def __setstate__(self, state):
  22. -> 1334 model = saving.unpickle_model(state)
  23. 1335 self.__dict__.update(model.__dict__)
  24. 1336
  25.  
  26. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\engine\saving.py in unpickle_model(state)
  27. 602 def unpickle_model(state):
  28. 603 h5dict = H5Dict(state, mode='r')
  29. --> 604 return _deserialize_model(h5dict)
  30. 605
  31. 606
  32.  
  33. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\engine\saving.py in _deserialize_model(h5dict, custom_objects, compile)
  34. 367 weighted_metrics=weighted_metrics,
  35. 368 loss_weights=loss_weights,
  36. --> 369 sample_weight_mode=sample_weight_mode)
  37. 370
  38. 371 # Set optimizer weights.
  39.  
  40. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\backend\tensorflow_backend.py in symbolic_fn_wrapper(*args, **kwargs)
  41. 73 if _SYMBOLIC_SCOPE.value:
  42. 74 with get_graph().as_default():
  43. ---> 75 return func(*args, **kwargs)
  44. 76 else:
  45. 77 return func(*args, **kwargs)
  46.  
  47. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\engine\training.py in compile(self, optimizer, loss, metrics, loss_weights, sample_weight_mode, weighted_metrics, target_tensors, **kwargs)
  48. 209
  49. 210 # Save all metric attributes per output of the model.
  50. --> 211 self._cache_output_metric_attributes(metrics, weighted_metrics)
  51. 212
  52. 213 # Set metric attributes on model.
  53.  
  54. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\engine\training.py in _cache_output_metric_attributes(self, metrics, weighted_metrics)
  55. 736 output_shapes.append(list(output.shape))
  56. 737 self._per_output_metrics = training_utils.collect_per_output_metric_info(
  57. --> 738 metrics, self.output_names, output_shapes, self.loss_functions)
  58. 739 self._per_output_weighted_metrics = (
  59. 740 training_utils.collect_per_output_metric_info(
  60.  
  61. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\engine\training_utils.py in collect_per_output_metric_info(metrics, output_names, output_shapes, loss_fns, is_weighted)
  62. 941 metric_name = get_metric_name(metric, is_weighted)
  63. 942 metric_fn = get_metric_function(
  64. --> 943 metric, output_shape=output_shapes[i], loss_fn=loss_fns[i])
  65. 944
  66. 945 # If the metric function is not stateful, we create a stateful version.
  67.  
  68. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\engine\training_utils.py in get_metric_function(metric, output_shape, loss_fn)
  69. 984 """
  70. 985 if metric not in ['accuracy', 'acc', 'crossentropy', 'ce']:
  71. --> 986 return metrics_module.get(metric)
  72. 987
  73. 988 is_sparse_categorical_crossentropy = (
  74.  
  75. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\metrics.py in get(identifier)
  76. 1976 return deserialize(config)
  77. 1977 elif isinstance(identifier, six.string_types):
  78. -> 1978 return deserialize(str(identifier))
  79. 1979 elif callable(identifier):
  80. 1980 return identifier
  81.  
  82. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\metrics.py in deserialize(config, custom_objects)
  83. 1968 module_objects=globals(),
  84. 1969 custom_objects=custom_objects,
  85. -> 1970 printable_module_name='metric function')
  86. 1971
  87. 1972
  88.  
  89. c:\users\dscally\appdata\local\programs\python\python37\lib\site-packages\keras\utils\generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
  90. 165 if fn is None:
  91. 166 raise ValueError('Unknown ' + printable_module_name +
  92. --> 167 ':' + function_name)
  93. 168 return fn
  94. 169 else:
  95.  
  96. ValueError: Unknown metric function:custom_mse
  97.  
RAW Paste Data