Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix list_devices() function is not available issue (#8567)
* fix list_devices() function is not available issue When using tensorflow as backend and the version of tensorflow is under r1.3, the list_devices() function is not available of Session instance. This may cause some issue like keras.utils.multi_gpu_model(model, gpus) function can not work under r1.3 of tensorflow. This change is a hack to fix that issue. * Update tensorflow_backend.py fix pep8 check failure * Update tensorflow_backend.py follow fchollet review comment. use `if not`.
- Loading branch information
@luoch @fchollet
The session.list_devices and the device_lib.list_local_devices() return a different output. Example:
To make this hack more effective we need to reshape the output. Also note that list_local_devices() has some unexpected side-effects documented here: #8377