Closed otpas007 closed 3 years ago
Maybe the params['entity_type']
contains a string not a tensor inside it.
Maybe the
params['entity_type']
contains a string not a tensor inside it.
I have checked the type of params['entity_type']
. It is a tensor. Whereas the type of encoder_outputs
is string.
Can you please tell me the necessary modifications I have to make to run the code?
It's weird, encoder_outputs
should be a tensor. Have you changed the code?
encoder_outputs
comes from the BERT outputs, are you using transformers == 3.1.0?
encoder_outputs
comes from the BERT outputs, are you using transformers == 3.1.0?
Yeah, it was a problem relating to the version of the transformers
.. I was using a higher version which was causing the issue. Now the code is running fine.
Thanks for the help and also great work done with the paper.
You're welcome!
You can replace the torch.cat or torch.stack with this problem " TypeError: expected Tensor as element 0 in argument 0, but got float " or "expected Tensor as element 0 in argument 0, but got numpy.float32 " or " TyprError: expected tensor as element 0 in argument 0 , but got int " to torch.tensor and it will work . worked for me .
Hi! I'm trying to train the neural network, using the default values provided in the script run_GAIN_BERT.sh (I just changed the bert_path from ../PLM/bert-base-uncased to bert-base-uncased), but the training script is giving me an error after beginning. The error stack trace is as follows:
Can you please help me in fixing it?
P.S. : The line numbers may vary by 2-3 lines as I have included some print statements to debug it myself.