我在C:\ Users \ xxy19 \ Anaconda3 \ envs \ tensorflow-gpu \ Lib \ site-packages \ keras \ backend的 init .py中添加了这两行:
from .load_backend import control_flow_ops
from .load_backend import set_image_dim_ordering
但是它仍然存在:
ImportError: cannot import name 'control_flow_ops' from 'keras.backend.load_backend' (C:\Users\xxy19\Anaconda3\envs\tensorflow-gpu\lib\site-packages\keras\backend\load_backend.py)
我如何成功使用tensorflow-gpu?实际上是版本兼容性问题吗?
答案 0 :(得分:0)
尝试一下
import tensorflow as tf
tf.python.control_flow_ops = tf