maxpumperla / hyperas

Keras + Hyperopt: A very simple wrapper for convenient hyperparameter optimization
http://maxpumperla.com/hyperas/
MIT License
2.18k stars 318 forks source link

can not import optim #272

Open xiaobenhou opened 4 years ago

xiaobenhou commented 4 years ago

Hello,

Below is the error message I got when I tried to import optim.

ModuleNotFoundError Traceback (most recent call last)

in ----> 1 from hyperas import optim ~\AppData\Local\Continuum\anaconda3\lib\site-packages\hyperas\optim.py in 9 from nbconvert import PythonExporter 10 ---> 11 from .ensemble import VotingModel 12 from .utils import ( 13 remove_imports, remove_all_comments, extract_imports, temp_string, ~\AppData\Local\Continuum\anaconda3\lib\site-packages\hyperas\ensemble.py in 1 import numpy as np ----> 2 from keras.models import model_from_yaml 3 4 5 class VotingModel(object): ModuleNotFoundError: No module named 'keras' Thanks
JonnoFTW commented 4 years ago

Have you tried installing keras?

pip install keras
xiaobenhou commented 4 years ago

Yes. Have done that before installing hyperas. I also tried to re-run pip install keras again and got the message below. I ran 'python -m pip install hyperas' under anaconda prompt to install the package.

Requirement already satisfied: keras in c:\users\xxx\appdata\local\continuum\anaconda3\lib\site-packages (2.3.1) Requirement already satisfied: numpy>=1.9.1 in c:\users\xxx\appdata\local\continuum\anaconda3\lib\site-packages (from keras) (1.16.5) Requirement already satisfied: scipy>=0.14 in c:\users\xxx\appdata\local\continuum\anaconda3\lib\site-packages (from keras) (1.3.1) Requirement already satisfied: six>=1.9.0 in c:\users\xxx\appdata\local\continuum\anaconda3\lib\site-packages (from keras) (1.12.0) Requirement already satisfied: pyyaml in c:\users\xxx\appdata\local\continuum\anaconda3\lib\site-packages (from keras) (5.1.2) Requirement already satisfied: h5py in c:\users\xxx\appdata\local\continuum\anaconda3\lib\site-packages (from keras) (2.9.0) Requirement already satisfied: keras_applications>=1.0.6 in c:\users\xxx\appdata\local\continuum\anaconda3\lib\site-packages (from keras) (1.0.8) Requirement already satisfied: keras_preprocessing>=1.0.5 in c:\users\xxx\appdata\local\continuum\anaconda3\lib\site-packages (from keras) (1.1.0)

On Mon, Feb 24, 2020 at 12:58 AM Jonathan Mackenzie < notifications@github.com> wrote:

Have you tried installing keras?

pip install keras

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxpumperla/hyperas/issues/272?email_source=notifications&email_token=AIGLFJLAS2STTAJPPNJWU5TRENOXHA5CNFSM4K2AWPD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMWWGUA#issuecomment-590177104, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGLFJOSVE4JEFT74MVU4ZDRENOXHANCNFSM4K2AWPDQ .