Closed gaurav-95 closed 1 year ago
Hi, @gaurav-95
Please run transformers-cli env
in terminal and share the full system info so it's easier to reproduce the error.
transformers-cli env gives me this.
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Admin\Desktop\Projects\NLP_Cron\cronenv\Scripts\transformers-cli.exe\__main__.py", line 4, in <module>
File "C:\Users\Admin\Desktop\Projects\NLP_Cron\cronenv\lib\site-packages\transformers\commands\transformers_cli.py", line 24, in <module>
from .pt_to_tf import PTtoTFCommand
File "C:\Users\Admin\Desktop\Projects\NLP_Cron\cronenv\lib\site-packages\transformers\commands\pt_to_tf.py", line 46, in <module>
tf.config.experimental.enable_tensor_float_32_execution(False)
AttributeError: module 'tensorflow' has no attribute 'config'
Could you elaborate on what system info do you need? Im running on an Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz 1.19 GHz 20.0 GB (19.8 GB usable) RAM
No dedicated gpu in machine. My virtualenvironment is called "cronenv"
Update: I was able to run the same code on a google colab notebook, seems like a problem with my environment.
Hi, @gaurav-95 Actually if you run the above code it should output something like this,
transformers
version: 4.25.1Since you are not getting it could you please check your transformers installation? (just run import transformers
and check if it successfully imports or gives an error)
Thanks for getting back and hinting towards the problem. I can confirm there was something wrong with my python installation.
Steps that resolved it for me.
Thanks for getting back and hinting towards the problem. I can confirm there was something wrong with my python installation.
Steps that resolved it for me.
- I made a requirements file of the existing install
- I deleted the existing virtual environment.
- Re-installed python.
- Re-installed dependencies from saved requirements file.
- Ran code and it works now!
LOL, I got the same thing happen to me as well I think??? Ill give this a try :) BTW how did you delete the env?
System Info
Windows 10, VSCode
Who can help?
No response
Information
I was referring to the documentation on huggingface to run the facebook OPT model here:
https://huggingface.co/docs/transformers/main/en/model_doc/opt#transformers.OPTForCausalLM
And I've received the following error on my Windows 10 machine in VScode.
I first thought it was specific to this model, But I'm facing the same issue on other models. I have tried uninstalling TensorFlow and reinstalling it.
I have upgraded "transformers" library as well. But to no avail. This seems to be a recent problem.
The virtual environment I'm using says I have these versions of tensorflow and transformers.
Reproduction
Steps to reproduce the behaviour:
Assuming required libraries are installed error message shows up.
Expected behavior
Expected the output as per shown in documentation.