6

I have a frustrating problem, where I cannot debug my pytorch code while in Pycharm.
While trying to inspect (breakpoint, then print e.g.) the code below, I receive a "Loading time out"

import torch

    tensors = []
    num_tensors = 16
    shape = (1, 3, 512, 512)
    for i in range(num_tensors):
        tensors.append(torch.zeros(shape))

I saw this[1,2] posts, set variable loading policy to syncronyous, disabled Qt debugger options, and all the options specified, But I believe there is something basic I'm missing.
pycharm 2019.2.5, happens both in python2 and python3.

DsCpp
  • 2,259
  • 3
  • 18
  • 46

2 Answers2

5

Are you using DataLoader? If yes, you can try reducing the num_workers to 0.

JasonWayne
  • 1,724
  • 1
  • 19
  • 16
0

I had this problem too. Both with the Pycharm version 2019.3.3, 2019.3.4 and 2019.2.6. I had to revert back to 2018.3.7 where it was working. I may have some parameters that caused the conflicts. It doesn't explain the underlying reason though...

Emile D.
  • 602
  • 2
  • 11
  • 20