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

AttributeError: module 'tensorflow._api.v1.config' has no attribute 'list_physical_devices' after running rasa init #7634

Closed
mathiasgodwin opened this issue Dec 24, 2020 · 5 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@mathiasgodwin
Copy link

Rasa version:2.2.2

Rasa SDK version : 2.2.0

Python version: 3.7.9

Operating system :windows

error:
c:\users\gwinivac.conda\envs\chatboty\lib\importlib_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
c:\users\gwinivac.conda\envs\chatboty\lib\importlib_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
c:\users\gwinivac.conda\envs\chatboty\lib\importlib_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
c:\users\gwinivac.conda\envs\chatboty\lib\importlib_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
return f(*args, **kwds)
Traceback (most recent call last):
File "c:\users\gwinivac.conda\envs\chatboty\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\users\gwinivac.conda\envs\chatboty\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Gwinivac.conda\envs\chatboty\Scripts\rasa.exe_main
.py", line 7, in
File "c:\users\gwinivac.conda\envs\chatboty\lib\site-packages\rasa_main
.py", line 115, in main
rasa.telemetry.initialize_error_reporting()
File "c:\users\gwinivac.conda\envs\chatboty\lib\site-packages\rasa\telemetry.py", line 230, in decorated
return f(*args, **kwargs)
File "c:\users\gwinivac.conda\envs\chatboty\lib\site-packages\rasa\telemetry.py", line 651, in initialize_error_reporting
default_context = _default_context_fields()
File "c:\users\gwinivac.conda\envs\chatboty\lib\site-packages\rasa\telemetry.py", line 480, in _default_context_fields
"gpu": len(tf.config.list_physical_devices("GPU")),
File "c:\users\gwinivac.conda\envs\chatboty\lib\site-packages\tensorflow_core\python\util\module_wrapper.py", line 193, in getattr
attr = getattr(self._tfmw_wrapped_module, name)
AttributeError: module 'tensorflow._api.v1.config' has no attribute 'list_physical_devices'

@mathiasgodwin mathiasgodwin added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Dec 24, 2020
@sara-tagger
Copy link
Collaborator

Thanks for the issue, @b-quachtran will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

@mathiasgodwin
Copy link
Author

Thanks for the issue, @b-quachtran will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

I've got a wrap around that, what I did was:

  1. i figured out that the attribute has been moved to "tensorflow._api.v1.config.experiment"
  2. I edit the "init.py" by :
    from tensorflow._api.v1.config import experiment
    list_physical_devices = experiment.list_physical_devices
  3. then I saved it and Viola! it worked (for Tesorflow version==1.15.0)

@indam23
Copy link
Contributor

indam23 commented Dec 28, 2020

I think the underlying issue here is your tensorflow version - you should have tensorflow 2 since #5266

@siddheshm14
Copy link

Thanks for the issue, @b-quachtran will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

I've got a wrap around that, what I did was:

  1. i figured out that the attribute has been moved to "tensorflow._api.v1.config.experiment"
  2. I edit the "init.py" by :
    from tensorflow._api.v1.config import experiment
    list_physical_devices = experiment.list_physical_devices
  3. then I saved it and Viola! it worked (for Tesorflow version==1.15.0)

@siddheshm14
Copy link

Can you tell me which init.py file was changed, I mean in which folder init.py was changed I am not able to get solve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

4 participants