Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubleshooting version incompatibility of transformers #16

Open
JunsolKim opened this issue Feb 17, 2022 · 0 comments
Open

Troubleshooting version incompatibility of transformers #16

JunsolKim opened this issue Feb 17, 2022 · 0 comments

Comments

@JunsolKim
Copy link

JunsolKim commented Feb 17, 2022

Hi all,

It seems that transformers returns the following issue if transformers version is incompatible with tensorflow or pytorch. Try to downgrade transformers to 3.1.0 if you encounter this error (pip install transformers==3.1.0).


RuntimeError Traceback (most recent call last)
/var/folders/jj/0bctc_l95rs6_k0g9qqhb4w40000gn/T/ipykernel_18520/4005870990.py in
1 from transformers import pipeline
----> 2 nlp = pipeline("sentiment-analysis")
3 result = nlp("I hate you")[0]
4 print(f"label: {result['label']}, with score: {round(result['score'], 4)}")
5 result = nlp("I love you")[0]

~/opt/anaconda3/envs/content/lib/python3.7/site-packages/transformers/pipelines/init.py in pipeline(task, model, config, tokenizer, feature_extractor, framework, revision, use_fast, use_auth_token, model_kwargs, pipeline_class, **kwargs)
546 revision=revision,
547 task=task,
--> 548 **model_kwargs,
549 )
550

~/opt/anaconda3/envs/content/lib/python3.7/site-packages/transformers/pipelines/base.py in infer_framework_load_model(model, config, model_classes, task, framework, **model_kwargs)
177 if not is_tf_available() and not is_torch_available():
178 raise RuntimeError(
--> 179 "At least one of TensorFlow 2.0 or PyTorch should be installed. "
180 "To install TensorFlow 2.0, read the instructions at https://www.tensorflow.org/install/ "
181 "To install PyTorch, read the instructions at https://pytorch.org/."

RuntimeError: At least one of TensorFlow 2.0 or PyTorch should be installed. To install TensorFlow 2.0, read the instructions at https://www.tensorflow.org/install/ To install PyTorch, read the instructions at https://pytorch.org/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant