Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neither PyTorch nor TensorFlow >= 2.0 have been found.Models won't be available and only tokenizers, configuration and file/data utilities can be used

I am trying to install transformers using pip

pip install transformers

after import transformers

this error show

Neither PyTorch nor TensorFlow >= 2.0 have been found.Models won't be available and only tokenizers, configuration, and file/data utilities can be used.

although I install TensorFlow-GPU= 2.3.1 and using conda

system info

Windows 10 
python 3.6
cuda 10.1
tensorflow-gpu= 2.3.1
like image 558
predactor Avatar asked Sep 06 '25 05:09

predactor


2 Answers

You need one of them PyTorch or Tensorflow.

You can check if tensorflow is installed or you can reinstall it

  1. pip uninstall tensorflow
  2. pip install tensorflow==2.2.0(you can install only tensorflow it worked same as tensorflow-gpu)
  3. pip uninstall transformers
  4. pip install transformers==3.3.1

If this doesn't solve it, try to upgrade your python to 3.7.8

like image 137
dengresarthak Avatar answered Sep 09 '25 22:09

dengresarthak


I found the problem after investigate for 10 hours

I installed tensorflow by using conda install tensorflow-gpu

and transformers by using pip after remove tensorflow-gpu and install it by using pip

it works fine

like image 27
predactor Avatar answered Sep 10 '25 00:09

predactor