awni / transducer

A Fast Sequence Transducer Implementation with PyTorch Bindings
Apache License 2.0
196 stars 36 forks source link

import error #12

Open jiay7 opened 2 years ago

jiay7 commented 2 years ago

I successfully compiled the source file, but there was a problem when using it.

1652236811(1)

csukuangfj commented 2 years ago

You can switch to another directory to run, e.g., your home directory. Don't use the current repo directory, since it contains a transducer folder.

jiay7 commented 2 years ago

In fact, I run this program on other directories My code:

import torch import transducer

rnnt_loss = transducer.TransducerLoss()

cuda = False # whether use GPU version acts = torch.FloatTensor([[[[0.1, 0.6, 0.1, 0.1, 0.1], [0.1, 0.1, 0.6, 0.1, 0.1], [0.1, 0.1, 0.2, 0.8, 0.1]], [[0.1, 0.6, 0.1, 0.1, 0.1], [0.1, 0.1, 0.2, 0.1, 0.1], [0.7, 0.1, 0.2, 0.1, 0.1]]]]) labels = torch.IntTensor([[1, 2]]) act_length = torch.IntTensor([2]) label_length = torch.IntTensor([2]) if cuda: acts = acts.cuda() labels = labels.cuda() act_length = act_length.cuda() label_length = label_length.cuda() acts = torch.autograd.Variable(acts, requires_grad=True) labels = torch.autograd.Variable(labels) act_length = torch.autograd.Variable(act_length) label_length = torch.autograd.Variable(label_length) print("acts:{}, labels:{}, act_length:{}, label_length:{}".format(acts.shape, labels, act_length, label_length)) loss = rnnt_loss(acts, labels, act_length, label_length) loss.backward()

This program also has the error

csukuangfj commented 2 years ago

You can use Google to search for the error message "fatbinData undefined symbol".