Shortcuts

MLflowVisBackend

class mmengine.visualization.MLflowVisBackend(save_dir, exp_name=None, run_name=None, tags=None, params=None, tracking_uri=None, artifact_suffix=('.json', '.log', '.py', 'yaml'))[源代码]

MLflow visualization backend class.

It can write images, config, scalars, etc. to a mlflow file.

实际案例

>>> from mmengine.visualization import MLflowVisBackend
>>> from mmengine import Config
>>> import numpy as np
>>> vis_backend = MLflowVisBackend(save_dir='temp_dir')
>>> img = np.random.randint(0, 256, size=(10, 10, 3))
>>> vis_backend.add_image('img.png', img)
>>> vis_backend.add_scalar('mAP', 0.6)
>>> vis_backend.add_scalars({'loss': 0.1,'acc':0.8})
>>> cfg = Config(dict(a=1, b=dict(b1=[0, 1])))
>>> vis_backend.add_config(cfg)
参数
  • save_dir (str) – The root directory to save the files produced by the backend.

  • exp_name (str, optional) – The experiment name. Default to None.

  • run_name (str, optional) – The run name. Default to None.

  • tags (dict, optional) – The tags to be added to the experiment. Default to None.

  • params (dict, optional) – The params to be added to the experiment. Default to None.

  • tracking_uri (str, optional) – The tracking uri. Default to None.

  • artifact_suffix (Tuple[str] or str, optional) – The artifact suffix. Default to (‘.json’, ‘.log’, ‘.py’, ‘yaml’).

add_config(config, **kwargs)[源代码]

Record the config to mlflow.

参数

config (Config) – The Config object

返回类型

None

add_image(name, image, step=0, **kwargs)[源代码]

Record the image to mlflow.

参数
  • name (str) – The image identifier.

  • image (np.ndarray) – The image to be saved. The format should be RGB.

  • step (int) – Global step value to record. Default to 0.

返回类型

None

add_scalar(name, value, step=0, **kwargs)[源代码]

Record the scalar data to mlflow.

参数
  • name (str) – The scalar identifier.

  • value (int, float, torch.Tensor, np.ndarray) – Value to save.

  • step (int) – Global step value to record. Default to 0.

返回类型

None

add_scalars(scalar_dict, step=0, file_path=None, **kwargs)[源代码]

Record the scalar’s data to mlflow.

参数
  • scalar_dict (dict) – Key-value pair storing the tag and corresponding values.

  • step (int) – Global step value to record. Default to 0.

  • file_path (str, optional) – Useless parameter. Just for interface unification. Default to None.

返回类型

None

close()[源代码]

Close the mlflow.

返回类型

None

property experiment

Return MLflow object.

Read the Docs v: v0.7.3
Versions
latest
stable
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.