python3.6 + tensorflow 1.8 + keras2.3.1
报错:
E:\Anaconda3\envs\tensorflow\python.exe E:/deep_learn/yaozh/train_multi-label-glove-10-noIPC-lstm.py
Using TensorFlow backend.
Traceback (most recent call last):
File "E:/deep_learn/yaozh/train_multi-label-glove-10-noIPC-lstm.py", line 9, in <module>
from keras.models import Sequential
File "E:\Anaconda3\envs\tensorflow\lib\site-packages\keras_init.py", line 3, in <module>
from . import utils
File "E:\Anaconda3\envs\tensorflow\lib\site-packages\keras\utils_init.py", line 6, in <module>
from . import conv_utils
File "E:\Anaconda3\envs\tensorflow\lib\site-packages\keras\utils\conv_utils.py", line 9, in <module>
from .. import backend as K
File "E:\Anaconda3\envs\tensorflow\lib\site-packages\keras\backend_init_.py", line 1, in <module>
from .load_backend import epsilon
File "E:\Anaconda3\envs\tensorflow\lib\site-packages\keras\backend\load_backend.py", line 90, in <module>
from .tensorflow_backend import *
File "E:\Anaconda3\envs\tensorflow\lib\site-packages\keras\backend\tensorflow_backend.py", line 13, in <module>
from tensorflow.python.keras.utils import tf_utils
ImportError: cannot import name 'tf_utils'
Process finished with exit code 1
解决方案为:
降版本
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple keras==2.1.5
网友评论