question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] importing transformers4rec.torch libraries gives error

See original GitHub issue

Bug description

After

!pip install transformers4rec[pytorch,nvtabular]

from transformers4rec import torch as tr

on a kaggle notebook I get the error:

TypeError: new() missing 1 required positional argument: ‘task’

Same with all other transformers4rec.torch libraries

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sararbcommented, Dec 13, 2022

I have just opened the PR https://github.com/NVIDIA-Merlin/Transformers4Rec/pull/576 that updates Transformers4Rec code with the latest release of Torchmetrics (0.11.0). In fact, Torchmetrics updated its classification metrics (Accuracy, Precision,…) to require a task argument that differentiates three classification tasks: ‘binary’, ‘multiclass’, or ‘multilabel’. When missing, it throws the error TypeError: __new__() missing 1 required positional argument: 'task' I hope this PR fixes the issue you are observing.

1reaction
Alfagovcommented, Dec 3, 2022

The problem is with Torchmetrics, the latest supported version I found is 0.10.3 and they just released 0.11

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] importing list_files fails in transformers4rec[pytorch ...
It does seem to be a general thing with v0.1.3. This fails as well: from transformers4rec import torch as tr ...
Read more >
transformers4rec - PyPI
Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation and can work with PyTorch.
Read more >
Transformer: Error importing packages. "ImportError: cannot ...
Change the torch version in colab by running this command !pip install torch==1.4.0. Then, It worked for me.
Read more >
Troubleshoot - Hugging Face
Sometimes errors occur, but we are here to help! This guide covers some of the most common issues we've seen and how you...
Read more >
Transformers4Rec: Building Session-Based ...
Here are some highlights of the Transformers4Rec library: ... #from transformers4rec import torch as tr from transformers4rec import tf as ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found