Skip to content

Error with Default Option "ana" When Computing Metrics #190

Open
@toshi-k

Description

@toshi-k

I'm using motmetrics==1.4.0 with nuscenes-devkit==1.1.11 and encountered some issues.

Although it is recommended to use motmetrics<=1.1.3 with the nuscenes devkit, the older versions of motmetrics do not support the latest version of Python. Therefore, I am attempting to update the packages.
https://github.com/nutonomy/nuscenes-devkit/blob/master/setup/requirements/requirements_tracking.txt

After some investigation, I found that modifications are needed in both motmetrics and the nuscenes devkit. Without any changes to motmetrics, I get the following error:

    def _compute(self, df_map, name, cache, options, parent=None):
        """Compute metric and resolve dependencies."""
        assert name in self.metrics, "Cannot find metric {} required by {}.".format(
            name, parent
        )
        already = cache.get(name, None)
        if already is not None:
            return already
        minfo = self.metrics[name]
        vals = []
        for depname in minfo["deps"]:
            v = cache.get(depname, None)
            if v is None:
                v = cache[depname] = self._compute(
                    df_map, depname, cache, options, parent=name
                )
            vals.append(v)
        if _getargspec(minfo["fnc"]).defaults is None:
            return minfo["fnc"](df_map, *vals)
        else:
>           return minfo["fnc"](df_map, *vals, **options)
E           TypeError: motar() got an unexpected keyword argument 'ana'

/python/3.11.8/lib/python3.11/site-packages/motmetrics/metrics.py:363: TypeError

It seems that the default option options = {"ana": ana} in metrics.py is causing this error:

        cache = {}
        options = {"ana": ana}
        for mname in metrics:
            cache[mname] = self._compute(
                df_map, mname, cache, options, parent="summarize"
            )

If I set the options as options = {}, it works without any errors.
Has anyone else encountered this error or knows how to handle this "ana" option?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions