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

Importing evo plotting tools results in headless CI failing #351

Closed
YoshuaNava opened this issue Nov 30, 2020 · 1 comment
Closed

Importing evo plotting tools results in headless CI failing #351

YoshuaNava opened this issue Nov 30, 2020 · 1 comment

Comments

@YoshuaNava
Copy link

YoshuaNava commented Nov 30, 2020

Description:
I implemented a thin wrapper over evo, along with unit tests which run on a CI server.

Whenever I try to run the tests locally, everything goes well. When I do so on the CI, I get the following exception:

(see Console Output)

This error happens because the CI is running everything in headless mode. To overcome it I tried setting the matplotlib backend to pdf by default

In my opinion the source of the issue lies here: https://github.com/MichaelGrupp/evo/blob/master/evo/tools/plot.py#L32
Where the matplotlib backend is set silently by evo. The backend defaults to PyQt5, which doesn't run in headless mode, and an exception is thrown.

I would suggest that the default backend is pdf instead: https://matplotlib.org/3.3.1/api/backend_pdf_api.html

Console output:


`ImportError: Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running`

Additional files:
Please attach all the files needed to reproduce the error.

Please give also the following information:

  • evo version number shown by evo pkg --version: v1.11.0
  • Python version shown by evo pkg --pyversion: 3.8.5
  • operating system and version (e.g. Ubuntu 16.04 or Windows 10): Ubuntu 20.4
  • did you change the source code? (yes / no): no
  • output of evo_config show --brief --no_color:
{
    "console_logging_format": "%(message)s",
    "euler_angle_sequence": "sxyz",
    "global_logfile_enabled": false,
    "plot_axis_marker_scale": 0.0,
    "plot_backend": "Qt5Agg",
    "plot_export_format": "pdf",
    "plot_figsize": [
        6,
        6
    ],
    "plot_fontfamily": "sans-serif",
    "plot_fontscale": 1.0,
    "plot_invert_xaxis": false,
    "plot_invert_yaxis": false,
    "plot_linewidth": 1.5,
    "plot_mode_default": "xyz",
    "plot_multi_cmap": "none",
    "plot_pose_correspondences": false,
    "plot_pose_correspondences_linestyle": "dotted",
    "plot_reference_alpha": 0.5,
    "plot_reference_color": "black",
    "plot_reference_linestyle": "--",
    "plot_seaborn_palette": "deep6",
    "plot_seaborn_style": "darkgrid",
    "plot_split": false,
    "plot_statistics": [
        "rmse",
        "median",
        "mean",
        "std",
        "min",
        "max"
    ],
    "plot_texsystem": "pdflatex",
    "plot_trajectory_alpha": 0.75,
    "plot_trajectory_cmap": "jet",
    "plot_trajectory_linestyle": "-",
    "plot_usetex": false,
    "plot_xyz_realistic": true,
    "ros_map_alpha_value": 1.0,
    "ros_map_unknown_cell_value": 205,
    "save_traj_in_zip": false,
    "table_export_data": "stats",
    "table_export_format": "csv",
    "table_export_transpose": true,
    "tf_cache_lookup_frequency": 10,
    "tf_cache_max_time": 10000.0
}

@MichaelGrupp
Copy link
Owner

MichaelGrupp commented Dec 1, 2020

Thanks for reporting this. I have always set it manually in CI, but it's better to have a working default.

The latest release now uses Agg in headless environments after installation or after evo_config reset plot_backend. This fixes the crash. Writing a PDF later then switches to the pdf renderer implicitly for the file export as far as I can tell.

fbb6541

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