[Untitled] RuntimeError: An attempt has been made to start a new process solution

There is a problem when running:
Insert image description hereInsert image description here
the parameters of the code torch.utils.data.DataLoaderr are as follows:
Insert image description here

Reason for the error : Multiple child processes can be used to load data in Linux, but not in Windows. Therefore, in Windows, the num_workers in the torch.utils.data.DataLoaderr of the data is set to 0 or the default setting (num_workers=0) is used. The value of num_workers cannot be customized, otherwise the situation shown above will occur.
Insert image description here

After modifying torch.utils.data.DataLoaderr to the default settings:
Insert image description here
Insert image description here
Running results: Normal operation
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_42620513/article/details/125123253