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

Why hyperas is executing Raw Text as code #287

Open
DagonArises opened this issue Feb 8, 2022 · 1 comment
Open

Why hyperas is executing Raw Text as code #287

DagonArises opened this issue Feb 8, 2022 · 1 comment

Comments

@DagonArises
Copy link

I have encountered this issue where the hyper optimisation code tries to execute a block of raw text somewhere else in the notebook, raising a ridiculous Syntax Error. Sometimes it works sometimes it begins to execute markdown or raw text.

Even when I delete the raw text block the error message still points to that raw text, 'Potential issue:'. What's going on?

Traceback (most recent call last):

  File "/Users/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-13-7ea6376dc3f4>", line 38, in <module>
    eval_space= True, notebook_name= 'MotorIns')

  File "/Users/anaconda3/lib/python3.6/site-packages/hyperas/optim.py", line 69, in minimize
    keep_temp=keep_temp)

  File "/Users/anaconda3/lib/python3.6/site-packages/hyperas/optim.py", line 98, in base_minimizer
    model_str = get_hyperopt_model_string(model, data, functions, notebook_name, verbose, stack)

  File "/Users/anaconda3/lib/python3.6/site-packages/hyperas/optim.py", line 189, in get_hyperopt_model_string
    imports = extract_imports(cleaned_source, verbose)

  File "/Users/anaconda3/lib/python3.6/site-packages/hyperas/utils.py", line 40, in extract_imports
    tree = ast.parse(source)

  File "/Users/anaconda3/lib/python3.6/ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)

  File "<unknown>", line 209
    Potential issue:
                  ^
SyntaxError: invalid syntax


@DagonArises
Copy link
Author

I have deleted all the blocks in markdown and raw text. Exited the notebook, terminated the running command prompt and restarted the kernel. Then hyperas works without issue.
Why is it not compatible with other languages in Jupytern notebook?

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

1 participant