Open
Description
Hi,
I use dap to debug python code, all works fine, but when I debug dataloader in pytorch code, it will hang.
from torch.utils.data import DataLoader
from torchvision import datasets
from torchvision.transforms import ToTensor
train_dataset = datasets.CIFAR10("/home/usr/research/code/data",
train=True,
download=True,
transform=ToTensor())
train_loader = DataLoader(train_dataset, 128, shuffle=True, num_workers=3)
for sample in train_loader: # set break point here, then dap-next, then nothing happens...
print(type(sample))
Here is the io log after dap-next
Sending:
{
"command": "next",
"arguments": {
"threadId": 1
},
"type": "request",
"seq": 11
}
Received:
{
"command": "next",
"success": true,
"request_seq": 11,
"type": "response",
"seq": 20
}
Received:
{
"body": {
"allThreadsContinued": true,
"threadId": 1
},
"event": "continued",
"type": "event",
"seq": 21
}
Received:
{
"body": {
"threadId": 12,
"reason": "started"
},
"event": "thread",
"type": "event",
"seq": 22
}
Sending:
{
"command": "threads",
"type": "request",
"seq": 12
}
Received:
{
"body": {
"threadId": 13,
"reason": "started"
},
"event": "thread",
"type": "event",
"seq": 23
}
Sending:
{
"command": "threads",
"type": "request",
"seq": 13
}
Received:
{
"body": {
"threadId": 14,
"reason": "started"
},
"event": "thread",
"type": "event",
"seq": 24
}
Sending:
{
"command": "threads",
"type": "request",
"seq": 14
}
Received:
{
"body": {
"threads": [
{
"name": "MainThread",
"id": 1
},
{
"name": "QueueFeederThread",
"id": 12
},
{
"name": "QueueFeederThread",
"id": 13
},
{
"name": "QueueFeederThread",
"id": 14
}
]
},
"command": "threads",
"success": true,
"request_seq": 12,
"type": "response",
"seq": 25
}
Received:
{
"body": {
"threads": [
{
"name": "MainThread",
"id": 1
},
{
"name": "QueueFeederThread",
"id": 12
},
{
"name": "QueueFeederThread",
"id": 13
},
{
"name": "QueueFeederThread",
"id": 14
}
]
},
"command": "threads",
"success": true,
"request_seq": 13,
"type": "response",
"seq": 26
}
Received:
{
"body": {
"connect": {
"port": 43119,
"host": "127.0.0.1"
},
"subProcessId": 15309,
"python": [
"/home/wangzongtao/anaconda3/envs/torch/bin/python"
],
"program": "/home/wangzongtao/test/test.py",
"name": "Subprocess 15309",
"request": "attach",
"type": "python"
},
"event": "debugpyAttach",
"type": "event",
"seq": 27
}
Received:
{
"body": {
"connect": {
"port": 43119,
"host": "127.0.0.1"
},
"subProcessId": 15310,
"python": [
"/home/wangzongtao/anaconda3/envs/torch/bin/python"
],
"program": "/home/wangzongtao/test/test.py",
"name": "Subprocess 15310",
"request": "attach",
"type": "python"
},
"event": "debugpyAttach",
"type": "event",
"seq": 28
}
Received:
{
"body": {
"threads": [
{
"name": "MainThread",
"id": 1
},
{
"name": "QueueFeederThread",
"id": 12
},
{
"name": "QueueFeederThread",
"id": 13
},
{
"name": "QueueFeederThread",
"id": 14
}
]
},
"command": "threads",
"success": true,
"request_seq": 14,
"type": "response",
"seq": 29
}
Received:
{
"body": {
"connect": {
"port": 43119,
"host": "127.0.0.1"
},
"subProcessId": 15315,
"python": [
"/home/wangzongtao/anaconda3/envs/torch/bin/python"
],
"program": "/home/wangzongtao/test/test.py",
"name": "Subprocess 15315",
"request": "attach",
"type": "python"
},
"event": "debugpyAttach",
"type": "event",
"seq": 30
}
- What is special with dataloader?
the dataloader of torchvision will try to download dataset from internet, if it found the dataset already downloaded it will use the local dataset. In above test I already download the dataset. - what is special with my internet?
I use proxy to asscess internet, it works all fine. - does vscode work correctly?
yes, vscode can debug corretly.
It seems this issue is related with internet, but I have no idea where is wrong?
Metadata
Metadata
Assignees
Labels
No labels