NiftyNet net_segment has no attribute '_logger'

346 views Asked by At

When I try to do the quickstart instructions for NiftyNet installed from PyPI I get the following error when running 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'

I have tried this on a Linux Mint 18.3 install (this one) as well as an Arch Linux install with SimpleITK.

Here is the same error on Arch Linux with NiftyNet installed from the AUR with SimpleITK installed.

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'

Solved by downgrading TensorFlow to version 1.7.

1

There are 1 answers

0
zach_er On

NiftyNet does not support TF 1.8 yet, as you have discovered.