ImportError: cannot import name '_get_logger' Niftynet

帅比萌擦擦* 提交于 2019-12-09 22:50:15

问题


I'm trying to run Niftynet on my PC. but it keeps showing this error. I had a CPU version for tensorflow and it worked. After that I installed tensorflow-gpu and now it stopped working.

Please do note that import tensorflow as tf works fine so I'm not sure what do to now to solve this problem.

Traceback (most recent call last):
  File "c:\users\halim\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\halim\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\halim\AppData\Local\Programs\Python\Python36\Scripts\net_run.exe\__main__.py", line 5, in <module>
  File "c:\users\halim\appdata\local\programs\python\python36\lib\site-packages\niftynet\__init__.py", line 48, in <module>
    set_logger()
  File "c:\users\halim\appdata\local\programs\python\python36\lib\site-packages\niftynet\io\misc_io.py", line 724, in set_logger
    from tensorflow.python.platform.tf_logging import _get_logger
ImportError: cannot import name '_get_logger' 

回答1:


You need to install only tensorflow-gpu, and install the correct version for it. First uninstall everything:

pip3 uninstall tensorflow-gpu tensorflow

Then reinstall the correct tensorflow-gpu version

pip3 install --user tensorflow-gpu==1.12

The version is mentioned in the installation guide: https://niftynet.readthedocs.io/en/dev/installation.html



来源:https://stackoverflow.com/questions/54271943/importerror-cannot-import-name-get-logger-niftynet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!