Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pytorch debugging timeout with PyCharm

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.

like image 662
DsCpp Avatar asked Nov 25 '19 11:11

DsCpp


1 Answers

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

like image 103
JasonWayne Avatar answered Oct 16 '22 12:10

JasonWayne