Dataloader problem in pyinstaller executable file

Has anyone ever built a PyTorch inference file with pyinstaller?

When iterating torch.utils.data.dataloader using enumerate, there was no problem when executing the Python file directly,

but if I build it as an executable file and run it, dataloader part is not executed and the executable file is restarted.

Hard to debug:(

Does anyone know a solution or has similar experience?

Thank ahead:)

Hi
I have the same problem
Have u fixed this issue?

@Nazar_Pankov you can refer to this page
https://www.reddit.com/r/learnpython/comments/o0ln04/why_is_parallel_processing_not_working_with/

try ‘num_worker=1’