OFA-Sys / OFA

Official repository of OFA (ICML 2022). Paper: OFA: Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence Learning Framework
Apache License 2.0
2.41k stars 248 forks source link

Question about label_smoothed_cross_entropy.py #362

Open jun297 opened 1 year ago

jun297 commented 1 year ago

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?

JustinLin610 commented 1 year ago

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

jun297 commented 1 year ago

I am using 1.13.1+cu117

johncaged commented 1 year ago

same problem with pytorch 1.8.1+cuda11.1

CH7auAI commented 3 months ago

same problem with torch 1.13+cuda 11.6