Closed mahdiabdollahpour closed 8 months ago
Hi mahdiabdollahpour
is the problem solved?
Hi mahdiabdollahpour
is the problem solved?
Hi
It's solved, but I do not remember exactly how?:) I think my input data dimension was not correct.
Got it, I'm having a similar problem, can you help? Code: [https://stackoverflow.com/questions/65459540/indexerror-dimension-out-of-range-expected-to-be-in-range-of-2-1-but-got]
I'll check it out. In the meantime, here is the code that was working for me. https://github.com/mahdiabdollahpour/Time-Series-with-Transformers-for-Brent-Oil-Price/blob/master/main.py
On Sun, Dec 27, 2020 at 12:34 AM Nur notifications@github.com wrote:
Got it, I'm having a similar problem, can you help? Code: [ https://stackoverflow.com/questions/65459540/indexerror-dimension-out-of-range-expected-to-be-in-range-of-2-1-but-got ]
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxjcohen/transformer/issues/21#issuecomment-751395989, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGOPPLO33BHD2Z7RTBZJXX3SWZFVLANCNFSM4SH6EXBQ .
--
Mohammad Mahdi Abdollah Pour
*Github https://mahdiabdollahpour.github.io/, *LinkedIn https://www.linkedin.com/in/mohammadmahdi-abdollahpour-a48b008b/
I run the code using the examples but I get this error on net(x), when model is doing keys.transpose in multiHeadAttention.py about line 91 in
the error is
IndexError: Dimension out of range (expected to be in range of [-2, 1], but got 2)
actually, keys must be in shape (batch_size, K, d_model), but it is not, so it has 2 dim instead of 3, so there is this error.but why keys tensor is not (batch_size, K, d_model)?
code to produce the error:
version 3 python 3.7.6 torch '1.5.0+cu101' windows 10