Skip to content

Why hyperas is executing Raw Text as code #287

@DaleMYChen

Description

@DaleMYChen

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


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions