Skip to content

Issue : Inconsistent model.train() calls in the training loop. #13

Description

@PrinceSajjadHussain

The code calls model.train() twice within the inner training loop (once before the loop and once inside). The second call is redundant and unnecessary.

model.train()
for batch_idx, (features, targets) in enumerate(train_loader):
    model.train() # redundant call

    features = features.to(device)
    targets = targets.to(device)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions