The problem occurs when doing machine learning training.
Reason for the error: The problem is due to multi-threading under windows, and is related to the DataLoader class. Just change the number of num_workers to 0. This is a bug in windows.
The error code can be referred to:
trainLoader=torch.utils.data.DataLoader(trainSet,batch_size=Bach_Size,shuffle=True,num_workers=2)
testLoader=torch.utils.data.DataLoader(testSet,batch_size=Bach_Size,shuffle=True,num_workers=2)
Set The number of num_ workers to 0
trainLoader=torch.utils.data.DataLoader(trainSet,batch_size=Bach_Size,shuffle=True,num_workers=0)
testLoader=torch.utils.data.DataLoader(testSet,batch_size=Bach_Size,shuffle=True,num_workers=0)
Read More:
- [Solved] pytorch Error: RuntimeError: Unable to find a valid cuDNN algorithm to run convolution
- RTX 3090 Run pytorch Error: CUDA error: no kernel image is available for execution on the device
- [Solved] Pytorch Download CIFAR1 Datas Error: urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certi
- How to Solve Pytorch eval Stuck Error
- [Solved] PyTorch Caught RuntimeError in DataLoader worker process 0和invalid argument 0: Sizes of tensors mus
- Python3.6 Run uvicorn Error: AttributeError: module ‘asyncio‘ has no attribute ‘run‘
- Pytorch ValueError: Expected more than 1 value per channel when training, got input size [1, 768
- [Pytorch Error Solution] Pytorch distributed RuntimeError: Address already in use
- Pytorch Error: runtimeerror: expected scalar type double but found float
- [Solved] Pytorch Error: RuntimeError: expected scalar type Double but found Float
- [Solved] RuntimeError : PyTorch was compiled without NumPy support
- Pytorch: error message with chunks of 0 [How to Solve]
- Pytorch directly creates a tensor on the GPU error [How to Solve]
- Pytorch torch.cuda.FloatTensor Error: RuntimeError: one of the variables needed for gradient computation has…
- [Solved] Pytorch-transformers Error: AttributeError: ‘str‘ object has no attribute ‘shape‘
- Install PyTorch in Anaconda environment
- [Solved] Pytorch-geometric Error: No module named torch_sparse
- [Solved] Pytorch Error: RuntimeError: Error(s) in loading state_dict for Network: size mismatch
- pytorch model.load_state_dict Error [How to Solve]
- [Solved] PyTorch Error: TypeError: exceptions must derive from BaseException