nikicc / twitter-emotion-recognition

Models for predicting emotions from English tweets.
GNU Affero General Public License v3.0
164 stars 67 forks source link

Name Error : h5py #9

Open Sali4faizi opened 5 years ago

Sali4faizi commented 5 years ago

Please help me solve the issue

runfile('C:/Users/iiitmk/Emotion_recognition/demo.py', wdir='C:/Users/iiitmk/Emotion_recognition') Reloaded modules: emotion_predictor Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/iiitmk/Emotion_recognition/demo.py', wdir='C:/Users/iiitmk/Emotion_recognition')

File "C:\Users\iiitmk\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile execfile(filename, namespace)

File "C:\Users\iiitmk\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/iiitmk/Emotion_recognition/demo.py", line 12, in model = EmotionPredictor(classification='ekman', setting='ml', use_unison_model=True)

File "C:\Users\iiitmk\Emotion_recognition\emotion_predictor.py", line 31, in init self.model = self._get_model()

File "C:\Users\iiitmk\Emotion_recognition\emotion_predictor.py", line 43, in _get_model return load_model(self._loaded_model_filename)

File "C:\Users\iiitmk\Anaconda3\lib\site-packages\keras\engine\saving.py", line 417, in load_model

File "C:\Users\iiitmk\Anaconda3\lib\site-packages\keras\utils\io_utils.py", line 182, in init

NameError: name 'h5py' is not defined

nikicc commented 5 years ago

@Sali4faizi it seems that the h5py dependency is missing. Try to install it with pip install h5py, if that doesn't work, please check this section of Keras documentation.

nikicc commented 5 years ago

Oh wait ... you are on Conda. Then use this instead of pip: conda install h5py.

Sali4faizi commented 5 years ago

@nikicc Thanks for your quick reply...h5py is already installed...but still showing this name error

nikicc commented 5 years ago

@Sali4faizi so if you try to import it in a python shell it works? Try do double check if importing it works as expected by opening a Python interpreter and type this:

>>> import h5py