-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Description
when run the code piece
seq_len = 60
_, x, y = next(iter(dataloader(1, 1, 8, seq_len, seq_len)))
result = evaluate(model.net, model.criterion, x, y)
y_out = result['y_out']
there comes the error information:
IndexError Traceback (most recent call last)
<ipython-input-41-127bd44fb490> in <module>()
1 seq_len = 60
2 _, x, y = next(iter(dataloader(1, 1, 8, seq_len, seq_len)))
----> 3 result = evaluate(model.net, model.criterion, x, y)
4 y_out = result['y_out']
D:\GithubProjs\pytorch-ntm-master\train.py in evaluate(net, criterion, X, Y)
151
152 result = {
--> 153 'loss': loss.data[0],
154 'cost': cost / batch_size,
155 'y_out': y_out,
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
how to solve it?
Metadata
Metadata
Assignees
Labels
No labels