PeerHerholz / BIDSonym

a BIDS app for pseudo-anonymization of neuroimaging data
https://peerherholz.github.io/BIDSonym/
BSD 3-Clause "New" or "Revised" License
51 stars 12 forks source link

deepdefacer doesn't not work #22

Closed julfou81 closed 4 years ago

julfou81 commented 4 years ago

Hi,

I got this error when I chose to process with deep defacer:

File "/opt/miniconda-latest/envs/bidsonym/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 506, in _get_available_gpus _LOCAL_DEVICES = tf.config.experimental_list_devices() AttributeError: module 'tensorflow_core._api.v2.config' has no attribute 'experimental_list_devices'

The solution I found on my local installation of deepdefacer was to edit line 506 of /anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py"

and change: _LOCAL_DEVICES = tf.config.experimental_list_devices()

to : devices = tf.config.list_logical_devices() _LOCAL_DEVICES = [x.name for x in devices]

I also posted the same message on the deepdefacer GitHub issue.

PeerHerholz commented 4 years ago

Hi @julfou81,

thank you very much for posting this issue.

Great catch and thx for providing the fix! I actually thought about removing deepdefacer support as it never really worked for any of the examples I tried. I'll check and get back to you asap.

julfou81 commented 4 years ago

Indeed deepfacer is super fast but it doesn't work well every time. The trick I did is to use it in a while loop in order to launch it many times when the output is not generated. This way I got it to work for all my images (40 T1w images including young and elderly subjects).

PeerHerholz commented 4 years ago

Thx for the additional information and insights. The problem I see with that is the rather unreproducible and unreliable character. I would thus propose a temporary removal and wait if it gets fixed on the deepdefacer site.

julfou81 commented 4 years ago

This makes sense to me. I will keep a look at deepfacer which is promising but still unreliable at the moment.

PeerHerholz commented 4 years ago

Cool, thx @julfou81! I'll close this for now, but please feel free to reopen if you have any news!