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

OSError, Err22, Trials() #149

Open tayfuntuna opened 6 years ago

tayfuntuna commented 6 years ago

I get this error message with the notebook example OSError Traceback (most recent call last)

in () 71 algo=tpe.suggest, 72 max_evals=5, ---> 73 trials=Trials()) 74 75 print("Evalutation of best performing model:") C:\Anaconda3\lib\site-packages\hyperas\optim.py in minimize(model, data, algo, max_evals, trials, functions, rseed, notebook_name, verbose, eval_space, return_space) 65 full_model_string=None, 66 notebook_name=notebook_name, ---> 67 verbose=verbose) 68 69 best_model = None C:\Anaconda3\lib\site-packages\hyperas\optim.py in base_minimizer(model, data, functions, algo, max_evals, trials, rseed, full_model_string, notebook_name, verbose, stack) 94 model_str = full_model_string 95 else: ---> 96 model_str = get_hyperopt_model_string(model, data, functions, notebook_name, verbose, stack) 97 temp_file = './temp_model.py' 98 write_temp_files(model_str, temp_file) C:\Anaconda3\lib\site-packages\hyperas\optim.py in get_hyperopt_model_string(model, data, functions, notebook_name, verbose, stack) 176 else: 177 calling_script_file = os.path.abspath(inspect.stack()[stack][1]) --> 178 with open(calling_script_file, 'r') as f: 179 source = f.read() 180 OSError: [Errno 22] Invalid argument: 'C:\\Users\\kaggle\\cgg\\'
HaveF commented 6 years ago

Do u know how to fix this now? thanks

HaveF commented 6 years ago

see this, "No such file or directory" when creating Jupyter notebook from scratch · Issue #83 · maxpumperla/hyperas

and this issue should be close

SantoshML commented 5 years ago

I am running my code using spyder but still facing the same error... I drilled down a bit and found that the error is coming from calling_script_file = os.path.abspath(inspect.stack()[stack][1]) with open(calling_script_file, 'r') as f: source = f.read()

Is this error is because I am setting my working directory at different location...

maxpumperla commented 5 years ago

@SantoshML hyperas is only properly supported from command line for this reason. it's difficult to infer the location of your hyperas script from IDEs, since they add layers to the call stack that are difficult to trace. btw, there's an open issue for Spyder and other IDEs (won't fix)

SantoshML commented 5 years ago

It's an amazing package and Please let me know in case if there is any possibility to use it through Spyder