Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError, Err22, Trials() #149

Open
tayfuntuna opened this issue Feb 13, 2018 · 5 comments
Open

OSError, Err22, Trials() #149

tayfuntuna opened this issue Feb 13, 2018 · 5 comments

Comments

@tayfuntuna
Copy link

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
Copy link
Contributor

HaveF commented Feb 23, 2018

Do u know how to fix this now? thanks

@HaveF
Copy link
Contributor

HaveF commented Feb 23, 2018

@SantoshML
Copy link

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
Copy link
Owner

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants