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

TypeError: accuracy() missing 1 required positional argument: 'task' #78

Open
Harishu1998 opened this issue Jul 11, 2023 · 1 comment
Open

Comments

@Harishu1998
Copy link

I am using model : spacetimeformer and dataset: asos.

When I run python train.py spacetimeformer asos --run_name test --gpus 0 I get this error.
TypeError: accuracy() missing 1 required positional argument: 'task'

Task variable seems to be a Literal with the following values
task: Literal["binary", "multiclass", "multilabel"],

But I am performing a timeseries forecasting so which Task value should I use?

Exact error location :

spacetimeformer\spacetimeformer\spacetimeformer_model\spacetimeformer_model.py", line 219, in classification_loss 
    acc = torchmetrics.functional.accuracy(
TypeError: accuracy() missing 1 required positional argument: 'task'
@QekSveYay
Copy link

The accuracy function of torchmetrics has a big change from v0.10 to v0.11, please refer to the following link:
https://torchmetrics.readthedocs.io/en/v0.10.0/classification/accuracy.html

You can just reinstall torchmetrics to version 0.10 to make the code runs.

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

No branches or pull requests

2 participants