ImportError: cannot import name np_utils
See original GitHub issueHi all,
I installed Keras with Anaconda on 2.7 python environement.
When I do the following : import keras
: I get the following error and it stack. I tried everything I could find on stack and google without any help. I even tried installing it on a freshly installed environement without any improvements.
----> 1 import keras
/home/mohamed/.local/lib/python2.7/site-packages/keras/init.py in <module>() 1 from future import absolute_import 2 ----> 3 from . import utils 4 from . import activations 5 from . import applications
/home/mohamed/.local/lib/python2.7/site-packages/keras/utils/init.py in <module>() 1 from future import absolute_import ----> 2 from . import np_utils 3 from . import generic_utils 4 from . import data_utils 5 from . import io_utils
ImportError: cannot import name np_utils
I checked the files. I am pretty sure they are there.
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (1 by maintainers)
try this
from tensorflow.python.keras.utils import np_utils
In the public API, you cannot access
np_util
(it’s internal). You are supposed to access utilities via theutils
module, e.g.