|
本帖最后由 kqqnhzl 于 2019-11-15 18:19 编辑
在开发表情识别的时候模型转换过出现 ImportError: cannot import name 'tf_utils' 错误 解决办法。
错误信息如下:
ai@ai-B85M-D3V-Plus:~/AI/face_classification/rknn_test$ python3 rknn_transfer.py
Using TensorFlow backend.
Traceback (most recent call last):
File "rknn_transfer.py", line 3, in <module>
from keras.models import load_model
File "/home/ai/.pyenv/versions/3.6.8/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/home/ai/.pyenv/versions/3.6.8/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils
File "/home/ai/.pyenv/versions/3.6.8/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/home/ai/.pyenv/versions/3.6.8/lib/python3.6/site-packages/keras/backend/__init__.py", line 1, in <module>
from .load_backend import epsilon
File "/home/ai/.pyenv/versions/3.6.8/lib/python3.6/site-packages/keras/backend/load_backend.py", line 90, in <module>
from .tensorflow_backend import *
File "/home/ai/.pyenv/versions/3.6.8/lib/python3.6/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'
tensorflow与keras版本兼容问题:我是用的tensorflow1.5与keras2.1.4
解决办法:
pip3 install keras==2.1.4
|
|