Bert For Sequence Classification with Keras fine tuning on GPU error

Dear all,

i try to move to GPU to fine tune a BERT classification model with Keras (like this hugginface tutorial).

I use TFAutoModelForSequenceClassification to load the model, but this class not have .to() function to move to GPU.

If I move to the general AutoModelForSequenceClassification i cannot have .compile() function to set


Any solutions?
Thanks in advance

I found in another post that tensorflow and keras use as default gpu when there is. Then there is no need method.
My problem was i didn’t cuda and cudnn install on docker. I fixed using the gpu version of tensorflow and keras.

1 Like