OFA icon indicating copy to clipboard operation
OFA copied to clipboard

Question about label_smoothed_cross_entropy.py

Open jun297 opened this issue 1 year ago • 4 comments

line 222 in label_smoothed_cross_entropy.py updated as the following: From net_output[0].masked_fill_(~constraint_masks, -math.inf) To net_output[0] = net_output[0].masked_fill(~constraint_masks, -math.inf)

(https://github.com/OFA-Sys/OFA/pull/341/commits/6a750999afff254623e7df95279776a460a20a50)

With the latest code, I got an error typeError: 'tuple' object does not support item assignment

I fixed by using the previous one. Is there any reason why it is changed?

jun297 avatar Mar 06 '23 12:03 jun297

Which version of pytorch are you using? This is because the problem of in-place operation in the new version of pytorch, for example, >=1.10

JustinLin610 avatar Mar 15 '23 06:03 JustinLin610

I am using 1.13.1+cu117

jun297 avatar Mar 15 '23 09:03 jun297

same problem with pytorch 1.8.1+cuda11.1

johncaged avatar Mar 22 '23 13:03 johncaged

same problem with torch 1.13+cuda 11.6

CH7auAI avatar Jul 29 '24 13:07 CH7auAI