Tensorflow NER Training script Not working
# 🐛 Bug
Tensorflow NER Training script Not working
## Information
I am following the exact guide at https://github.com/huggingface/transformers/tree/master/examples/token-classification
Model I am using (Bert, XLNet ...): BERT

Language I am using the model on (English, Chinese ...): English

The problem arises when using:
python run_tf_ner.py --data_dir ./ \
--labels ./labels.txt \
--model_name_or_path $BERT_MODEL \
--output_dir $OUTPUT_DIR \
--max_seq_length  $MAX_LENGTH \
--num_train_epochs $NUM_EPOCHS \
--per_device_train_batch_size $BATCH_SIZE \
--save_steps $SAVE_STEPS \
--seed $SEED \
--do_train \
--do_eval \
--do_predict


The tasks I am working on is:
Training NER on germeval data


Steps to reproduce the behavior:
Follow the official guide at https://github.com/huggingface/transformers/tree/master/examples/token-classification

<!-- ValueError: Variable <tf.Variable 'tf_bert_for_token_classification/bert/pooler/dense/kernel:0' shape=(768, 768) dtype=float32> has `None` for gradient. Please make sure that all of your ops have
 a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval.-->

## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->

## Environment info
<!-- 
- `transformers` version: 2.9.1
- Platform: Linux-3.10.0-1062.9.1.el7.x86_64-x86_64-with-centos-7.7.1908-Core
- Python version: 3.6.10
- PyTorch version (GPU?): not installed (NA)
- Tensorflow version (GPU?): 2.2.0 (True)
- Using GPU in script?: Yes, both Single and multi-GPU training
- Using distributed or parallel set-up in script?: Yes-->
     
- `transformers` version:

The documentation i guess is not updated for Tensorflow training, an additional parameter "logging_dir" is required in case of TF. 

- `transformers` version: 2.9.1
- Platform: Linux-3.10.0-1062.9.1.el7.x86_64-x86_64-with-centos-7.7.1908-Core
- Python version: 3.6.10
- PyTorch version (GPU?): not installed (NA)
- Tensorflow version (GPU?): 2.2.0 (True)
- Using GPU in script?: Yes both single gpu and multi-gpu training
- Using distributed or parallel set-up in script?: Yes<|||||>Error log:
 ValueError: Variable <tf.Variable 'tf_bert_for_token_classification/bert/pooler/dense/kernel:0' shape=(768, 768) dtype=float32> has `None` for gradient. Please make sure that all of your ops have
 a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval.<|||||>Tried with TF 2.0:
Error Message: AttributeError: module 'tensorflow_core._api.v2.config' has no attribute 'list_physical_devices'
TF 2.1: Same as TF 2.2 i.e. ValueError: Variable <tf.Variable 'tf_bert_for_token_classification/bert/pooler/dense/kernel:0' shape=(768, 768) dtype=float32> has `None` for gradient. Please make sure that all of your ops have
 a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval.<|||||>I had same issue.
add ```--mode token-classification``` to the command
reference code https://github.com/huggingface/transformers/blob/18d233d52588b4e08dc785fbfecd77529e9effa6/src/transformers/trainer_tf.py#L380<|||||>Thanks @linhx13 ..Works fine..