mindspore.train
mindspore.train.summary
SummaryRecord.
User can use SummaryRecord to dump the summary data, the summary is a series of operations to collect data for analysis and visualization.
- class mindspore.train.summary.SummaryRecord(log_dir, file_prefix="events", file_suffix="_MS", network=None, max_file_size=None, raise_exception=False, export_options=None)[source]
SummaryRecord is used to record the summary data and lineage data.
The API will create a summary file and lineage files lazily in a given directory and writes data to them. It writes the data to files by executing the ‘record’ method. In addition to recording the data bubbled up from the network by defining the summary operators, SummaryRecord also supports to record extra data which can be added by calling add_value.
Note
Make sure to close the SummaryRecord at the end, otherwise the process will not exit. Please see the Example section below to learn how to close properly in two ways.
Only one SummaryRecord instance is allowed at a time, otherwise it will cause data writing problems.
SummaryRecord only supports Linux systems.
- Parameters
log_dir (str) – The log_dir is a directory location to save the summary.
file_prefix (str) – The prefix of file. Default: “events”.
file_suffix (str) – The suffix of file. Default: “_MS”.
network (Cell) – Obtain a pipeline through network for saving graph summary. Default: None.
max_file_size (int, optional) – The maximum size of each file that can be written to disk (in bytes). For example, to write not larger than 4GB, specify max_file_size=4*1024**3. Default: None, which means no limit.
raise_exception (bool, optional) – Sets whether to throw an exception when a RuntimeError or OSError exception occurs in recording data. Default: False, this means that error logs are printed and no exception is thrown.
export_options (Union[None, dict]) –
Per