NeptuneVisBackend¶
- class mmengine.visualization.NeptuneVisBackend(save_dir=None, init_kwargs=None)[源代码]¶
Neptune visualization backend class.
示例
>>> from mmengine.visualization import NeptuneVisBackend >>> from mmengine import Config >>> import numpy as np >>> init_kwargs = {'project': 'your_project_name'} >>> neptune_vis_backend = NeptuneVisBackend(init_kwargs=init_kwargs) >>> img = np.random.randint(0, 256, size=(10, 10, 3)) >>> neptune_vis_backend.add_image('img', img) >>> neptune_vis_backend.add_scalar('mAP', 0.6) >>> neptune_vis_backend.add_scalars({'loss': 0.1, 'acc': 0.8}) >>> cfg = Config(dict(a=1, b=dict(b1=[0, 1]))) >>> neptune_vis_backend.add_config(cfg)
备注
New in version 0.9.0.
- 参数:
save_dir (str, optional) – The root directory to save the files produced by the visualizer. NeptuneVisBackend does not require this argument. Defaults to None.
init_kwargs (dict, optional) –
Neptune initialization parameters. Defaults to None.
project (str): Name of a project in a form of namespace/project_name. If project is not specified, the value of NEPTUNE_PROJECT environment variable will be taken.
api_token (str): User’s API token. If api_token is not api_token, the value of NEPTUNE_API_TOKEN environment variable will be taken. Note: It is strongly recommended to use NEPTUNE_API_TOKEN environment variable rather than placing your API token here.
If ‘project’ and ‘api_token are not specified in init_kwargs, the ‘mode’ will be set to ‘offline’. See neptune.init_run for details.
- add_config(config, **kwargs)[源代码]¶
Record the config to neptune.
- 参数:
config (Config) – The Config object
- 返回类型:
None
- add_scalars(scalar_dict, step=0, file_path=None, **kwargs)[源代码]¶
Record the scalars’ data.
- 参数:
- 返回类型:
None
- property experiment¶
Return Neptune object.