# Transformer for TF 1.15.0?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformer-for-tf-1-15-0%2F14875%3E%5C
**Category:** 🤗Transformers\
**Created:** [February 18, 2022, 6:30pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformer-for-tf-1-15-0%2F14875 "2022-02-18T18:30:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinmin](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@martinmin](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmartinmin)%5C
**Post date:** [February 18, 2022, 6:30pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformer-for-tf-1-15-0%2F14875%2F1 "2022-02-18T18:30:29Z")

</div>

I have to use TF 1.15 in my project, but it seems that Transformer have to be used with \>=TF2.0. Is that right? I got this error for a testing:

```auto
from sklearn.metrics.pairwise import cosine_similarity
import tensorflow as tf
from transformers import BertTokenizer, TFBertModel

tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = TFBertModel.from_pretrained('bert-base-uncased')
input_ids = tf.constant(tokenizer.encode("Hello, my dog is cute"))[None, :]  
outputs = model(input_ids)
last_hidden_states = outputs[0]

```

And the error message is below:

```auto
Traceback (most recent call last):
  File "/Users/nlu/tests/random_test.py", line 67, in <module>
    model = TFBertModel.from_pretrained('bert-base-uncased')
  File "/Users/bm/venv/bm/lib/python3.7/site-packages/transformers/utils/dummy_tf_objects.py", line 542, in from_pretrained
    requires_backends(cls, ["tf"])
  File "/Users/bm/venv/bm/lib/python3.7/site-packages/transformers/file_utils.py", line 822, in requires_backends
    raise ImportError("".join([BACKENDS_MAPPING[backend][1].format(name) for backend in backends]))
ImportError: 
TFBertModel requires the TensorFlow library but it was not found in your environment. Checkout the instructions on the
installation page: https://www.tensorflow.org/install and follow the ones that match your environment.

```

Is there a way to get transorformer with TF 1.15?

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [February 18, 2022, 8:15pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformer-for-tf-1-15-0%2F14875%2F2 "2022-02-18T20:15:55Z")

</div>

The minimal version of supported by Transformers is TensorFlow 2.3

---

<div class="post-metadata">

**Author:** ![martinmin](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@martinmin](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmartinmin)%5C
**Post date:** [February 18, 2022, 9:34pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftransformer-for-tf-1-15-0%2F14875%2F3 "2022-02-18T21:34:19Z")

</div>

Good to know. Thanks.
