check_version not valid
Author: gwc4github
Pull request: no

## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->

- `transformers` version: 4.4.2
- Platform: AWS Sagemaker
- Python version: 3.6
- PyTorch version (GPU?): N/A
- Tensorflow version (GPU?): 2.4.1 (kernal: conda_tensorflow2_p36)
- Using GPU in script?: no
- Using distributed or parallel set-up in script?: no

### Who can help
<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.
@LysandreJik, @sgugger, @patil-suraj

Models: Bert

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @LysandreJik

Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

Model hub:

- for issues with a model report at https://discuss.huggingface.co/ and tag the model's creator.

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->

## Information

Model I am using (Bert, XLNet ...): Bert 

The problem arises when using:
* [X ] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [ ] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

1. Run sample Sagemaker notebook:    ./notebooks/sagemaker/02_getting_started_tensorflow/
2. Change the entry_point from "train.py" to "run_ner.py"
3. Copy run_ner.py from the examples for ner:  .\transformers\examples\token-classification\run_ner.py
3. Execute notebook 
4. Line 47 executes a  check_min_version("4.5.0.dev0")  but that version does not exist. Newest version I see is 4.4.2.  This results in the following error message:



Lines 47-48:
   # Will error if the minimal version of Transformers is not installed. Remove at your own risks.
   check_min_version("4.5.0.dev0")

![image](https://user-images.githubusercontent.com/3164663/112927978-da565900-90e3-11eb-9672-d4c7c4f73c4f.png)

<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->
I am trying to get a baseline Sagemaker notebook working that fine tunes Bert for token classification.  (Using Colnn2003 or other.)   This should use the new Sagemaker Deep Learning Containers.  This is a first step for the project where we will next use custom data to fine tune the model.  

Comments:
Hi, what's the problem?

> Hi, what's the problem?

Sorry, I accidentally saved the ticket before I was done.  Then I had to leave my desk for a while.  I have updated the ticket with all the info now.

Thanks!

Ah, I see! This is because you're using a script which comes from the `master` branch. Version `v4.5.0dev0` is the development version of the v4.5.0 version, which is the current `master`. 

The scripts you use from the GitHub repository are always synced with `master`, so please be sure to use the source installation of the `master` branch of `transformers` alongside it.

If you want to use a script compatible with version `v4.4.2`, I would suggest taking the script from the tag `v4.4.2`, as this one will work with that version: 

https://github.com/huggingface/transformers/blob/9f43a425fe89cfc0e9b9aa7abd7dd44bcaccd79a/examples/token-classification/run_ner.py#L43-L55

Hello @gwc4github,

Happy to see that you are already using the new Hugging Face Deep Learning Container and the Sagemaker-sdk. Regarding your issue. If you want to use the `examples` script you have to configure the `git_config` like that.

```python
# configure git settings
git_config = {'repo': 'https://github.com/huggingface/transformers.git','branch': 'v4.4.2'} 
```
While branch `v4.4.1` is referring to the `transformers_version` in the HuggingFace estimator.

For your example, the estimator would look like 

```python
# git configuration to download our fine-tuning script
git_config = {'repo': 'https://github.com/huggingface/transformers.git','branch': 'v4.4.2'}

# hyperparameters, which are passed into the training job
hyperparameters={'epochs': 1,
                                  'train_batch_size': 32,
                                  'model_name':'distilbert-base-uncased'
                                  }

huggingface_estimator = HuggingFace(entry_point='run_ner.py', # script
                            source_dir='./examples/token-classification', # relative path to example
                            base_job_name='huggingface-sdk-extension',
                            git_config=git_config,
                            instance_type='ml.p3.2xlarge',
                            instance_count=1,
                            transformers_version='4.4',
                            tensorflow_version='2.4',
                            py_version='py37',
                            role=role,
                            hyperparameters = hyperparameters)
```

You can find more information about using `git_config` [here](https://huggingface.co/transformers/sagemaker.html#git-repository)


Thanks Lysandre and Phil.
I didn't follow what Lysandre was explaining enough to do anything with it yet, but I did the following with Phil's information.
I added the git_config line and then had to add a dataset_name as well. So no my code is as follows below.  However, when I run it I get the error that I have also included *after* the code.  I have also attached the full cell output.

```
from sagemaker.huggingface import HuggingFace

# hyperparameters, which are passed into the training job
hyperparameters={'epochs': 1,
                 'train_batch_size': 32,
                 'model_name':'bert-base-uncased',
                 'output_dir':'/opt/ml/model',
                 'dataset_name':'conll2003'
                }

# git configuration to download our fine-tuning script
git_config = {'repo': 'https://github.com/huggingface/transformers.git','branch': 'v4.4.2'}


huggingface_estimator = HuggingFace(entry_point='run_ner.py', # script
                            source_dir='./examples/token-classification', # relative path to example
                            base_job_name='huggingface-sdk-extension',
                            git_config=git_config,
                            instance_type='ml.p3.2xlarge',
                            instance_count=1,
                            transformers_version='4.4',
                            tensorflow_version='2.4',
                            py_version='py37',
                            role=role,
                            hyperparameters = hyperparameters)


```

ERROR:
```
Invoking script with the following command:

/usr/local/bin/python3.7 run_ner.py --dataset_name conll2003 --epochs 1 --model_name bert-base-uncased --output_dir /opt/ml/model --train_batch_size 32


2021-03-30 21:48:35.696262: W tensorflow/core/profiler/internal/smprofiler_timeline.cc:460] Initializing the SageMaker Profiler.
2021-03-30 21:48:35.696429: W tensorflow/core/profiler/internal/smprofiler_timeline.cc:105] SageMaker Profiler is not enabled. The timeline writer thread will not be started, future recorded events will be dropped.
2021-03-30 21:48:35.740003: W tensorflow/core/profiler/internal/smprofiler_timeline.cc:460] Initializing the SageMaker Profiler.
Traceback (most recent call last):
  File "run_ner.py", line 501, in <module>
    main()
  File "run_ner.py", line 181, in main
    model_args, data_args, training_args = parser.parse_args_into_dataclasses()
  File "/usr/local/lib/python3.7/site-packages/transformers/hf_argparser.py", line 196, in parse_args_into_dataclasses
    raise ValueError(f"Some specified arguments are not used by the HfArgumentParser: {remaining_args}")
ValueError: Some specified arguments are not used by the HfArgumentParser: ['--epochs', '1', '--train_batch_size', '32']

2021-03-30 21:48:37,576 sagemaker-training-toolkit ERROR    ExecuteUserScriptError:
Command "/usr/local/bin/python3.7 run_ner.py --dataset_name conll2003 --epochs 1 --model_name bert-base-uncased --output_dir /opt/ml/model --train_batch_size 32"
2021-03-30 21:48:35.696262: W tensorflow/core/profiler/internal/smprofiler_timeline.cc:460] Initializing the SageMaker Profiler.
2021-03-30 21:48:35.696429: W tensorflow/core/profiler/internal/smprofiler_timeline.cc:105] SageMaker Profiler is not enabled. The timeline writer thread will not be started, future recorded events will be dropped.
2021-03-30 21:48:35.740003: W tensorflow/core/profiler/internal/smprofiler_timeline.cc:460] Initializing the SageMaker Profiler.
Traceback (most recent call last):
  File "run_ner.py", line 501, in <module>
    main()
  File "run_ner.py", line 181, in main
    model_args, data_args, training_args = parser.parse_args_into_dataclasses()
  File "/usr/local/lib/python3.7/site-packages/transformers/hf_argparser.py", line 196, in parse_args_into_dataclasses
    raise ValueError(f"Some specified arguments are not used by the HfArgumentParser: {remaining_args}")
ValueError: Some specified arguments are not used by the HfArgumentParser: ['--epochs', '1', '--train_batch_size', '32']

2021-03-30 21:48:45 Uploading - Uploading generated training model
2021-03-30 21:49:27 Failed - Training job failed

```
[errLogs2021.03.30.txt](https://github.com/huggingface/transformers/files/6232459/errLogs2021.03.30.txt)


Hey @gwc4github,
as the error is saying 
```
ValueError: Some specified arguments are not used by the HfArgumentParser: ['--epochs', '1', '--train_batch_size', '32']
```
you pass in the wrong `hyperparameters`. If you take a look at the `run_ner.py` script and how it parses the arguments, you will notice it. The script parses the `parser = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments))`. The `ModelArguments` and `DataTrainingArguments` are defined directly in the script and the `TrainingArguments` can you find [here](https://huggingface.co/transformers/main_classes/trainer.html#transformers.TrainingArguments).

The hyperparameters you use `epochs`, `train_batch_size` and `model_name` have been only defined in the script for the [example](https://github.com/huggingface/notebooks/blob/4c909862282d551958629bec59c5712c010e4420/sagemaker/02_getting_started_tensorflow/scripts/train.py#L16) 

When you use the existing examples you stay need to provide the arguments as they are defined in the script in your example it would be
```python
hyperparameters={'num_train_epochs': 1,
                 'per_device_train_batch_size': 32,
                 'model_name_or_path':'bert-base-uncased',
                 'output_dir':'/opt/ml/model',
                 'dataset_name':'conll2003'
                }
```

**Additionally:** I noticed that you want to use the `Tensorflow` and the `Tensorflow` based DLC with `run_ner.py`. The `run_ner.py` only works with `Pytorch` so you have to replace `tensorflow_version` with `pytorch_version` and change the `py_version`. Please take a look at the [documentation here](https://huggingface.co/transformers/sagemaker.html). All your problems are addressed there.


Thanks @philschmid and team.  This did fix that problem and I understand completely what you are saying.  I have gotten a lot further.
There are some new issues but they are unrelated to this original problem so I will open new tickets as needed.  This ticket can be closed.  THANKS again for your quick and detailed help!!!

Gregg