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

Weird error in training #1

Open
ianni67 opened this issue Jan 28, 2024 · 1 comment
Open

Weird error in training #1

ianni67 opened this issue Jan 28, 2024 · 1 comment

Comments

@ianni67
Copy link

ianni67 commented Jan 28, 2024

Hi, while running the example pynb, I got the following error:

======== Epoch 1 / 3 ========
Training...

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <module>:89                                                                                   │
│                                                                                                  │
│    86 │   │   # calculate the average loss at the end. `loss` is a Tensor containing a           │
│    87 │   │   # single value; the `.item()` function just returns the Python value               │
│    88 │   │   # from the tensor.                                                                 │
│ ❱  89 │   │   total_train_loss += loss.item()                                                    │
│    90 │   │                                                                                      │
│    91 │   │   # Perform a backward pass to calculate the gradients.                              │
│    92 │   │   loss.backward()                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'str' object has no attribute 'item'

Looks like something is wrong, the model is not producing a correct output.
Any hint to solve this?

@parrrthhh
Copy link

I'm getting the same 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

No branches or pull requests

2 participants