Closed shashankvasisht closed 2 years ago
HI @shashankvasisht, based on the error messages, it looks like you're running this on a local notebook instead of running on Google colab directly? If not, make sure you have the exact version of the transformers (3.0.2) package (their future releases might be not be backwards compatible) and other packages as well (use pip freeze
inside the notebook to check). I just reran the notebook and it ran successfully to completion.
@shashankvasisht
Hi, I just got the same error and found the issue.
This error pops up if you are using the newer 4.0 ver of transformers.
So one solution is what @GokuMohandas recommended and the other would be to add the argument return_dict=False
when you pass inputs to your model:
seq, pool = self.transformer(input_ids=ids, attention_mask=masks, return_dict=False)
Rest all works fine, cheers!
Hi Goku... I am really thankful for all your amazing tutorials.
I however was facing some issues in the Transformers lecture. There are a few minor bugs here with missing variables and imports; which was not an issue.
The training code however is missing the block:
Also when i wrote this and ran it, I got an error:
Apparently, the issue comes from the line :
wherein the "pool" returned is of class string. Upon printing the type and the value of it i get the following :
Can you please have a look into this. Thanks in Advance!!