Skip to content

error when run train.py #1

@zhenwwang

Description

@zhenwwang

[ERROR 01]
File "./classifier\local_classifier.py", line 10, in
from backward_hooks import *
ModuleNotFoundError: No module named 'backward_hooks'

I just comment this line,then the second error occured

[ERROR 02]
File "C:\Users\Wang\Desktop\8_12\layer_augmentation-master\data.py", line 251, in getitem
char1 = self.char_idx[all_source.contiguous()].view(batch_l, source_l, token_l)
IndexError: tensors used as indices must be long, byte or bool tensors

I fixed this,by add .type(torch.uint8) like this
"char1=self.char_idx[all_source.contiguous().view(-1).type(torch.uint8)].view(batch_l, source_l, token_l)"

but errors continued:

[ERROR 03]
File "C:\Users\Wang\Desktop\8_12\layer_augmentation-master\data.py", line 252, in getitem
char1 = self.char_idx[all_source.contiguous().view(-1).type(torch.uint8)].view(batch_l, source_l, token_l)
IndexError: The shape of the mask [320] at index 0 does not match the shape of the indexed tensor [34292, 16] at index 0

What should I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions