You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello jason,
thanks for your implementation! good job!
however, when i wanted to train the music transformer, i found that there is a mistake in the "train.py".
i received this error:
Traceback (most recent call last):
File "train.py", line 92, in
metrics = metric_set(sample, batch_y)
File "/home/mirlab2019/wanglei/MusicTransformer-pytorch/custom/metrics.py", line 69, in call
return self.forward(input=input, target=target)
File "/home/mirlab2019/wanglei/MusicTransformer-pytorch/custom/metrics.py", line 75, in forward
for k, metric in self.metrics.items()}
File "/home/mirlab2019/wanglei/MusicTransformer-pytorch/custom/metrics.py", line 75, in
for k, metric in self.metrics.items()}
AttributeError: 'tuple' object has no attribute 'to'
After further discovering, i found that the reason is that a tuple is returned in the line 91, train.py. And then the returned tuple is transferred to "metric_set()", however "metric_set()" should receive a tensor instead of a tuple. Actually, adding a new variable to receive the returned attention weights could avoid the above error.
The text was updated successfully, but these errors were encountered:
hello jason,
thanks for your implementation! good job!
however, when i wanted to train the music transformer, i found that there is a mistake in the "train.py".
i received this error:
Traceback (most recent call last):
File "train.py", line 92, in
metrics = metric_set(sample, batch_y)
File "/home/mirlab2019/wanglei/MusicTransformer-pytorch/custom/metrics.py", line 69, in call
return self.forward(input=input, target=target)
File "/home/mirlab2019/wanglei/MusicTransformer-pytorch/custom/metrics.py", line 75, in forward
for k, metric in self.metrics.items()}
File "/home/mirlab2019/wanglei/MusicTransformer-pytorch/custom/metrics.py", line 75, in
for k, metric in self.metrics.items()}
AttributeError: 'tuple' object has no attribute 'to'
After further discovering, i found that the reason is that a tuple is returned in the line 91, train.py. And then the returned tuple is transferred to "metric_set()", however "metric_set()" should receive a tensor instead of a tuple. Actually, adding a new variable to receive the returned attention weights could avoid the above error.
The text was updated successfully, but these errors were encountered: