当我尝试执行从 PyPI 安装的 NiftyNet 的快速入门说明时,运行 net_segment 时出现以下错误:
net_segment inference -c ~/niftynet/extensions/dense_vnet_abdominal_ct/config.ini
WARNING:tensorflow:SimpleITK adapter failed to load, reducing the supported file formats.
Traceback (most recent call last):
File "/usr/local/bin/net_segment", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/niftynet/__init__.py", line 51, in main
set_logger()
File "/usr/local/lib/python2.7/dist-packages/niftynet/io/misc_io.py", line 585, in set_logger
tf.logging._logger.handlers = []
AttributeError: 'module' object has no attribute '_logger'
我已经在 Linux Mint 18.3 安装(这个)以及带有 SimpleITK 的 Arch Linux 安装上尝试过这个。
这是从安装了 SimpleITK 的 AUR 安装 NiftyNet 的 Arch Linux 上的相同错误。
net_segment inference -c ~/niftynet/extensions/dense_vnet_abdominal_ct/config.ini
Traceback (most recent call last):
File "/usr/bin/net_segment", line 11, in <module>
load_entry_point('NiftyNet==0.2.2', 'console_scripts', 'net_segment')()
File "/usr/lib/python3.6/site-packages/niftynet/__init__.py", line 51, in main
set_logger()
File "/usr/lib/python3.6/site-packages/niftynet/io/misc_io.py", line 585, in set_logger
tf.logging._logger.handlers = []
AttributeError: module 'tensorflow.tools.api.generator.api.logging' has no attribute '_logger'
通过将 TensorFlow 降级到 1.7 版解决。