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

Error on result page #187

Open
rcoenen opened this issue Jul 4, 2019 · 4 comments
Open

Error on result page #187

rcoenen opened this issue Jul 4, 2019 · 4 comments

Comments

@rcoenen
Copy link

rcoenen commented Jul 4, 2019

Hi, ok I finally managed to get Japonicus complete a full run.
Just for the purpose to test a quick full run, I modified various settings to get the process to speed up:

  • 10 EPOCHS instead of 3000 (default)
  • 10 DeltaDays instead of 90 (default)
  • 20 POP_SIZE instead of 50 (default)
  • 10 dataset_span instead of 0 (default)
  • 10 eval_dataset_span instead of 0 (default)

At the end of the run the terminal showed the settings that I could use on Gekko.
However, when I went to the Japonicus web interface and clicked on the "View Results" tab, the webpage remained empty and I got this in the Terminal:

ERROR:flask.app:Exception on /_dash-update-component [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/dist-packages/dash_auth/basic_auth.py", line 33, in wrap
    response = f(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/dash/dash.py", line 1073, in dispatch
    response.set_data(self.callback_map[output]['callback'](*args))
  File "/usr/local/lib/python3.6/dist-packages/dash/dash.py", line 969, in add_context
    output_value = func(*args, **kwargs)
  File "/home/ubuntu/gekko/japonicus/promoterz/webServer/core.py", line 100, in display_page
    return layout.getResults(app)
  File "/home/ubuntu/gekko/japonicus/promoterz/webServer/layout.py", line 87, in getResults
    return [html.P(str(r[0]) + '\n' + r) for r in app.resultParameters]
  File "/home/ubuntu/gekko/japonicus/promoterz/webServer/layout.py", line 87, in <listcomp>
    return [html.P(str(r[0]) + '\n' + r) for r in app.resultParameters]
TypeError: must be str, not tuple
@rcoenen
Copy link
Author

rcoenen commented Jul 4, 2019

Update: half-assed fix

in /home/ubuntu/gekko/japonicus/promoterz/webServer/layout.py line 87
changed
return [html.P(str(r[0]) + '\n' + r) for r in app.resultParameters]
into
return [html.P(str(r[0]) + '\n' + str(r) ) for r in app.resultParameters]

Now the web-UI results tab shows a slightly awkwardly formatted
-3.729552660176836 (-3.729552660176836, 'interval = 14.672\n\n[thresholds]\nhigh = 51.94\nlow = 35.22\npersistence = 1.09\n')

but at least it does not throw any errors in the terminal
image

@rcoenen
Copy link
Author

rcoenen commented Jul 4, 2019

NOTE: I am running Gekko + Japonicus under a 'screen' session on EC2, so the error thrown in the terminal when clicking the "View Results" tab in the web UI displaces the GA results in the Terminal... it is really hard to scroll back and see the final results! It's therefore really important to me that the Web UI functions properly. Imagine I'd be running a serious 3000 epoch session and after 72hrs I get the results... only to be washed away with some python error!

@IAMtheIAM
Copy link
Contributor

I have the same error, let's see about a fix.

@IAMtheIAM
Copy link
Contributor

IAMtheIAM commented Jul 9, 2019

Hey @rcoenen

Here is a good fix

As you mentioned, it was solved by changing line 87 in ./promoterz/webServer/layout.py with this code. This will make it print nicely in a textarea so you can directly copy and paste it from there :-)

def getResults(app):
    return [html.Textarea(str(r[0]) + '\n' + str(r[1]), style={'width': '525', 'height': '550'}) for r in app.resultParameters]

I made a PR

IAMtheIAM added a commit to IAMtheIAM/japonicus that referenced this issue Jul 9, 2019
Fixes Gab0#190 and Gab0#187

It makes the HTML output for the best parameters appear in a textarea so they show up formatted and can easily be copied from there.
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

2 participants