Skip to content

NameError: name 'remake_label' is not defined #9

Description

@gursimarkaur999

I'm trying to train the model on WESAD. But got this error on main.py

Traceback (most recent call last):
File "/content/Husformer/main.py", line 117, in
test_loss = train.initiate(hyp_params, train_loader, valid_loader, test_loader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/Husformer/src/train.py", line 30, in initiate
return train_model(settings, hyp_params, train_loader, valid_loader, test_loader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/Husformer/src/train.py", line 137, in train_model
_,mae_train = train(model, optimizer, criterion)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/Husformer/src/train.py", line 76, in train
raw_loss = criterion(preds, eval_attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/torch/nn/modules/module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/Husformer/src/utils.py", line 45, in forward
target = remake_label(target).type(torch.int64)
^^^^^^^^^^^^
NameError: name 'remake_label' is not defined

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