Error while enumerating Datamodule #2195
-
I am loading custom dataset fro folder, thereafter trying to enumerate the dataset. But landed into following error. RuntimeError: DataLoader worker (pid(s) 15836, 27364, 27808, 30772, 24408, 27804, 112476, 111348) exited unexpectedly Snapshot of the code block is given below: datamodule = Folder(
name="vials",
root="E:\PROJECTS\TestAnomalib\TrainSET",
normal_dir="good",
# abnormal_dir="abnormal",
normal_split_ratio=0.2,
extensions=".bmp",
# image_size=(256, 256),
train_batch_size=8,
eval_batch_size=4,
task=TaskType.CLASSIFICATION,
)
datamodule.setup()
i, data = next(enumerate(datamodule.val_dataloader()))
print(data.keys()) If anybody could help me on this. it would be of great help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It sounds like workers crashed for some reason. Can you set |
Beta Was this translation helpful? Give feedback.
-
if you set it to 0, which is actually default in pytorch dataloader, the data will be loaded in the main process. For more details you could refer to the following documentation: |
Beta Was this translation helpful? Give feedback.
It sounds like workers crashed for some reason. Can you set
num_workers=0
inFolder
and try again?