Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRF layer keeps resulting in CUDA: Device Side Assert Triggered error #3

Open
harunkuf opened this issue Dec 27, 2020 · 4 comments
Open

Comments

@harunkuf
Copy link

Hi, I wrote the code for BERT token classification from scratch and was looking around how to add the CRF layer on top of the model for NER task. Ran into your repo and found it useful, thanks for that! However, after I add the CRF layer I keep getting CUDA error due to limitations with ram. I'm currently using Colab with a Tesla T4 GPU. For reference, I'm using seq_len = 200, number of labels = 9 and batch size = 64. I tried with batch size 1 out of curiousity to see what happens and I still got the same error. I mean the card isn't bad, without the CRF layer I was able to train the model even with batch size 128 so I'm reall confused here.

My question is: With which GPU did you train your model with? Did you ever run into this problem after adding the CRF layer? If not, do you have any suggstions for me? Thank you very much in advance!

@Dhanachandra
Copy link
Owner

Dhanachandra commented Dec 29, 2020

I don't get this point "CUDA error due to limitations with ram". I trained the model using google colab. Please have a look at this example here.

@Astudnew
Copy link

Astudnew commented Feb 9, 2021

Thanks, it works fine.
I have question if you can help me. my work with bert+CRF(not on English language) gives a poor result compared to fin-tunned bert, I do not understand why? do you have any justification?

@Dhanachandra
Copy link
Owner

Dhanachandra commented Feb 10, 2021 via email

@Astudnew
Copy link

Exactly, that what I did, I used a pre-trained model in my language with CRF but the performance is less than fine-tuned bert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants