# How can I use transformers with TensorFlow on M1 Macbook?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-use-transformers-with-tensorflow-on-m1-macbook%2F5226%3E%5C
**Category:** 🤗Transformers\
**Created:** [March 31, 2021, 9:22am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-use-transformers-with-tensorflow-on-m1-macbook%2F5226 "2021-03-31T09:22:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paddy](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@Paddy](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FPaddy)%5C
**Post date:** [March 31, 2021, 9:22am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-can-i-use-transformers-with-tensorflow-on-m1-macbook%2F5226%2F1 "2021-03-31T09:22:01Z")

</div>

# I’m using a Macbook Air with M1, and I’ve installed tensorflow 2.4-rc0 according to this article: [https://zhuanlan.zhihu.com/p/343769603](https://zhuanlan.zhihu.com/p/343769603) It’s all right with the test script:

import tensorflow as tf  
import time

mnist = tf.keras.datasets.mnist

(x\_train, y\_train),(x\_test, y\_test) = mnist.load\_data()  
x\_train, x\_test = x\_train / 255.0, x\_test / 255.0

model = tf.keras.models.Sequential([  
tf.keras.layers.Flatten(input\_shape=(28, 28)),  
tf.keras.layers.Dense(128, activation=‘relu’),  
tf.keras.layers.Dropout(0.2),  
tf.keras.layers.Dense(10, activation=‘softmax’)  
])

model.compile(optimizer=‘adam’,  
loss=‘sparse\_categorical\_crossentropy’,  
metrics=[‘accuracy’])

start = time.time()

model.fit(x\_train, y\_train, epochs=5)

end = time.time()

# model.evaluate(x\_test, y\_test) print(end - start)

 ![QQ20210331-171559](https://us1.discourse-cdn.com/hellohellohello/original/2X/8/8c3fd02aad3b7c9d1ec9f740cb441eb43e2a33cf.png)

but when I try import transformers , an error will be throw out:  
None of PyTorch, TensorFlow \>= 2.0, or Flax have been found. Models won’t be available and only tokenizers, configuration and file/data utilities can be used.

Why? Can someone help me?
