查询运行记录与对象

使用Repo对象来查询和访问已保存的Run

初始化一个Repo实例:

from aim import Repo

my_repo = Repo('/path/to/aim/repo')

Repo 类的完整 spec

查询记录的指标和参数:

query = "metric.name == 'loss'" # Example query

# Get collection of metrics
for run_metrics_collection in my_repo.query_metrics(query).iter_runs():
    for metric in run_metrics_collection:
        # Get run params
        params = metric.run[...]
        # Get metric values
        steps, metric_values = metric.values.sparse_numpy()

除了查询Run运行记录和指标外,您还可以查询已记录的Image图像对象:

query = "images.name == 'mnist_dataset' and images.context.subset == 'val"

# Get collection of Image sequences
for image_seq in my_repo.query_images(query).iter():
    # Get first tracked batch of each sequence
    image_batch = image_seq.values.first_value()
    # Get Image metadata
    image_meta = map(Image.json, image_batch)
    # Convert to PILImage
    pil_images = map(Image.to_pil_image, image_batch)

Image 类的完整 规范

查看更高级的使用示例 这里