Just learning pytorch, a run of code to the
For I, (imgs, the targets, _, _) in enumerate (dataloader) :
Problems, according to other places, can't be changed num_workers to 0, so opt. Num_workers is 4,
Dataloader=dataloader (dataset,
Batch_size=batch_size,
Num_workers=opt. Num_workers,
Shuffle=True, # disable rectangular training if True
Pin_memory=True,
Collate_fn=dataset. Collate_fn)
How can I change, thank you,
Traceback (the most recent call last) :
The File "" train". Py ", line 344, in & lt; module>
Results="train" (
The File "" train". Py ", line 208, in "train"
For I, (imgs, the targets, _, _) in enumerate (dataloader) :
The File "/data/ABC/anaconda3/lib/python3.8/site - packages/torch/utils/data/dataloader py", line 435, in __next__
Data=(https://bbs.csdn.net/topics/self._next_data)
The File "/data/ABC/anaconda3/lib/python3.8/site - packages/torch/utils/data/dataloader py", line 475, in _next_data
Data=https://bbs.csdn.net/topics/self._dataset_fetcher.fetch # (index) may raise StopIteration
The File "/data/ABC/anaconda3/lib/python3.8/site - packages/torch/utils/data/_utils/fetch. Py", line 44, fetch in
Data=https://bbs.csdn.net/topics/[self. The dataset for independence idx possibly_batched_index] in [independence idx]
The File "/data/ABC/anaconda3/lib/python3.8/site - packages/torch/utils/data/_utils/fetch. Py", line 44, in & lt; Listcomp>
Data=https://bbs.csdn.net/topics/[self. The dataset for independence idx possibly_batched_index] in [independence idx]
The File "/home/ABC/bankuai/utils/datasets. Py", line 288, in the __getitem__
Img, thewire, padw padh=the letterbox (img, new_shape=shape, mode='square')
The File "/home/ABC/bankuai/utils/datasets. Py", line 384, in the letterbox
Img=cv2. CopyMakeBorder (img, top, bottom, left, right, cv2. BORDER_CONSTANT, value=https://bbs.csdn.net/topics/color) # padded square
Cv2. Error: OpenCV (4.5.1)/TMP/PIP - the req - build - ms668fyv/OpenCV/modules/core/SRC/copy. The CPP: 1493: error: (- 215: an Assertion failed) value [0]==value [1] & amp; & The value [0]==value [2] & amp; & The value [0]==value [3] in the function 'copyMakeBorder'