Skip to content

Logging textcat breaks on score name cats_score_desc in base_logger.py #4

@ceesroele

Description

@ceesroele

For textcat the dictionary other_scores contains cats_score_desc which has a description, e.g. "F1 macro", rather than a loss value. When passed on to AIM through the call aim_run.track(loss_value, name=loss_name, context={'type':f'other_scores_{score_name}'}, epoch=epoch, step=step) the normalization of the loss value results in an error.

Solution: add a test for the score name ending in '_desc' in base_logger.py in the method aim_log_step.

if isinstance(other_scores, dict):
    for score_name, loss_value in other_scores.items():
        if not isinstance(loss_value, dict) and not score_name.endswith('_desc'):  # <-- extra condition for _desc
            aim_run.track(loss_value, name=loss_name, context={'type':f'other_scores_{score_name}'}, 
                                     epoch=epoch, step=step)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions