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

bug fixed: for loss and accuracy calculation in train.py #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Yeaseen
Copy link

@Yeaseen Yeaseen commented Mar 28, 2024

Torch version: 1.12.0+cu102
Google Colab CPU runtime.
First error:
part_1

so, torch._C._nn.cross_entropy_loss function accepts a tensor.
solve: pass the tensor while calculating loss.
part_2

Then, another error occurred:
part_3

solve: the loss variable must be float type as it handles float type data
part4

Then, another error occurred:
part_6

So, again, pass the tensor while calculating accuracy:
part7

Finally, it's running successfully:
part_8

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 this pull request may close these issues.

None yet

1 participant