santhoshkolloju / Abstractive-Summarization-With-Transfer-Learning

Abstractive summarisation using Bert as encoder and Transformer Decoder
407 stars 98 forks source link

ValueError: Dimensions must be equal, but are 768 and 512 for 'bert/transformer_encoder_1/layer_0/add' #45

Closed noabenefraim closed 4 years ago

noabenefraim commented 4 years ago

ValueError: Dimensions must be equal, but are 768 and 512 for 'bert/transformer_encoder_1/layer_0/add' (op: 'AddV2') with input shapes: [?,?,768], [?,?,512].

Can you please help me resolve this dimension error. Thanks

santhoshkolloju commented 4 years ago

Chose Bert base which has 512 as embedding dimension

On Fri, 10 Jul, 2020, 9:58 PM noabenefraim, notifications@github.com wrote:

ValueError: Dimensions must be equal, but are 768 and 512 for 'bert/transformer_encoder_1/layer_0/add' (op: 'AddV2') with input shapes: [?,?,768], [?,?,512].

Can you please help me resolve this dimension error. Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/santhoshkolloju/Abstractive-Summarization-With-Transfer-Learning/issues/45, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA774GIPCWXMJF6PL5G4XOTR246TNANCNFSM4OWXYHRA .

noabenefraim commented 4 years ago

I modified the bert_config,json file to have "hidden_size": 512 and it fixed the issue.