Closed lessw2020 closed 3 years ago
Thank you very much for reporting the error! What torch and numpy version are you using and does running the example also not work?
Thanks for the fast reply. 1 - The example code works fine for a)regular embedding and b)with my added init code. 2 - The example code fails with same error for a)using relative pos embedding and b)with my added init code.
*I wanted to confirm my init wasnt' somehow messing up the embedding. Here's what I ran (with a quad sample of T/F for using relative pos embedding and init:
versions: np = 1.18.3 torch = 1.7.1
These might be older so let me upgrade as possible fix.
Alright strange for me it does also work with those numpy and torch versions. What python version do you use?
Hi - it now works for me after upgrading numpy to 1.19:
for python version I have:
Note that I am on Win10 - not sure if that would affect things but since most are on linux, it could be an issue.
Anyway, it is fixed with the upgrade to numpy 1.19 so I think if people hit this, upgrading numpy would be the quickest resolution.
Thanks again both for making the swin_impl and for the fast help on this issue. I'll test out training with the relative pos embedding next :)
Perfect, thank you again for reporting this issue. Have fun! :)
I also got this err with torch 1.8.1 and numpy 1.19.2. I tried to change the 119 of swim_transformer.py to dots += self.pos_embedding[self.relative_indices[:, :, 0].type(torch.long), self.relative_indices[:, :, 1].type(torch.long)] Finally, the test code run. I want to know if this fix will let the result from this net decay? Forgive my poor expression. Thank you.
Very big thanks for making this implementation! I just upgraded to the relative pos embedding update from an hour ago and in trying to train get this type error.