Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
toshi-k opened this issue May 30, 2024 · 0 comments · May be fixed by #191
Open

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

toshi-k opened this issue May 30, 2024 · 0 comments · May be fixed by #191

Comments

@toshi-k
Copy link

toshi-k commented May 30, 2024

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?

@toshi-k toshi-k linked a pull request May 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant