Score:-1

Remote Desktop freezes when running code in terminal but not in Pycharm

to flag

I am having an extremely weird issue. Debug suggestions/fixes highly appreciated because it is preventing integration of new code into the team's workflow.

I have a deep learning pytorch code running in a conda environment. When I run it from pycharm setting the environmenet's interpreter, everything works great. When I conda activate the same environment and run the code, it freezes at the end of an epoch, possibly at the stage of saving to disk. The Window Remote Desktop session shows windows. The mouse works but clicks or hotkeys don't do anything. Closing and reopening the Remote Desktop yields the same result, and I cannot log in as another user. Other users logging on from other machines are unaffected by my freeze. The freeze happens across machines and users, all on Ubuntu 18.04 (not allowed to update to 22.x). We use xrdp Xorg to log in.

I've tried debugging and asking for suggestions on the conda/pytorch/python side but the type of freeze and difference with pycharm vs terminal is something I don't understand.

Score:0
to flag

The issue was being caused by python's matplotlib taking over the OS backend. Pycharm switches backends on startup. Any of the following solutions work:

  1. Just use Pycharm.
  2. Install Qt5Agg in the python environment (which also switches the backend on install).
  3. Add matplotlib.use([one of the stable backends]) in the top-level or the plotting python functions.

This is consistent with and resolves all of the symptoms.

Thanks for the downvote, most helpful, Linux, community!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.