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

Internal error for the plot score vs. time #577

Open
glemaitre opened this issue May 21, 2022 · 4 comments
Open

Internal error for the plot score vs. time #577

glemaitre opened this issue May 21, 2022 · 4 comments

Comments

@glemaitre
Copy link
Collaborator

I get an error when trying to show the score vs. time:

image

image

We should have some python code failing somewhere.

@glemaitre
Copy link
Collaborator Author

FYI, the log error:

May 21 09:56:14 ramp.studio gunicorn[28387]: [2022-05-21 09:56:14,889] [ERROR] Exception on /event_plots/air_passengers_dssp_21 [GET]
May 21 09:56:14 ramp.studio gunicorn[28387]: Traceback (most recent call last):
May 21 09:56:14 ramp.studio gunicorn[28387]:   File "/opt/miniconda3/envs/new-server/lib/python3.8/site-packages/flask/app.py", line 2073, in
May 21 09:56:14 ramp.studio gunicorn[28387]:     response = self.full_dispatch_request()
May 21 09:56:14 ramp.studio gunicorn[28387]:   File "/opt/miniconda3/envs/new-server/lib/python3.8/site-packages/flask/app.py", line 1518, in
May 21 09:56:14 ramp.studio gunicorn[28387]:     rv = self.handle_user_exception(e)
May 21 09:56:14 ramp.studio gunicorn[28387]:   File "/opt/miniconda3/envs/new-server/lib/python3.8/site-packages/flask/app.py", line 1516, in
May 21 09:56:14 ramp.studio gunicorn[28387]:     rv = self.dispatch_request()
May 21 09:56:14 ramp.studio gunicorn[28387]:   File "/opt/miniconda3/envs/new-server/lib/python3.8/site-packages/flask/app.py", line 1502, in
May 21 09:56:14 ramp.studio gunicorn[28387]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
May 21 09:56:14 ramp.studio gunicorn[28387]:   File "/opt/miniconda3/envs/new-server/lib/python3.8/site-packages/flask_login/utils.py", line 
May 21 09:56:14 ramp.studio gunicorn[28387]:     return func(*args, **kwargs)
May 21 09:56:14 ramp.studio gunicorn[28387]:   File "/opt/miniconda3/envs/new-server/lib/python3.8/site-packages/ramp_frontend/views/ramp.py"
May 21 09:56:14 ramp.studio gunicorn[28387]:     p = score_plot(db.session, event)
May 21 09:56:14 ramp.studio gunicorn[28387]:   File "/opt/miniconda3/envs/new-server/lib/python3.8/site-packages/ramp_frontend/views/visualiz
May 21 09:56:14 ramp.studio gunicorn[28387]:     fill_colors_1 = color_gradient(
May 21 09:56:14 ramp.studio gunicorn[28387]:   File "/opt/miniconda3/envs/new-server/lib/python3.8/site-packages/ramp_frontend/views/visualiz
May 21 09:56:14 ramp.studio gunicorn[28387]:     colors = gray2rgb(
May 21 09:56:14 ramp.studio gunicorn[28387]: IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed

@glemaitre
Copy link
Collaborator Author

I should probably stop to click everywhere today :)

@rth
Copy link
Collaborator

rth commented May 24, 2022

As far as I can tell, there is one extra slicing depth in

which needs removing.

Minimal example to reproduce,

from ramp_frontend.views.visualization import color_gradient

fill_color_1 = (176, 23, 31)

color_gradient(fill_color_1, [0.5, 0.1, 0.3])

That code was last changed 5 years ago, and I can't see anything relevant in scikit-image changelog, so no idea why this is happening :)

@frcaud
Copy link
Collaborator

frcaud commented Dec 19, 2022

@rth @glemaitre Test on a local server on my machine gives me this warning that can be related to what we observe:
ramp-frontend/ramp_frontend/views/visualization.py:43: FutureWarning: The behavior of rgb2gray will change in scikit-image 0.19. Currently, rgb2gray allows 2D grayscale image to be passed as inputs and leaves them unmodified as outputs. Starting from version 0.19, 2D arrays will be treated as 1D images with 3 channels.

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

3 participants