You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D:\ProgramData\Anaconda3\python.exe D:/code/python/ssd.pytorch/train.py
Loading base network...
Initializing weights...
Loading the dataset...
Training SSD on: VOC0712
Using the specified args:
Namespace(basenet='vgg16_reducedfc.pth', batch_size=32, cuda=True, dataset='VOC', dataset_root='D:\code\python\ssd.pytorch\data/VOCdevkit/', gamma=0.1, lr=0.001, momentum=0.9, num_workers=4, resume=None, save_folder='weights/', start_iter=0, visdom=False, weight_decay=0.0005)
Traceback (most recent call last):
File "D:/code/python/ssd.pytorch/train.py", line 261, in
train()
File "D:/code/python/ssd.pytorch/train.py", line 150, in train
batch_iterator = iter(data_loader)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 359, in iter
return self._get_iterator()
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 305, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 944, in init
self._reset(loader, first_iter=True)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 975, in _reset
self._try_put_index()
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 1209, in _try_put_index
index = self._next_index()
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 512, in _next_index
return next(self._sampler_iter) # may raise StopIteration
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\sampler.py", line 229, in iter
for idx in self.sampler:
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\sampler.py", line 126, in iter
yield from torch.randperm(n, generator=generator).tolist()
RuntimeError: Expected a 'cuda' device type for generator but found 'cpu'
The text was updated successfully, but these errors were encountered:
Change the data_loader definition sentence(approximately at line 145) to the following sentence :
data_loader = data.DataLoader(dataset, args.batch_size,
num_workers=args.num_workers,
shuffle=True, collate_fn=detection_collate,
pin_memory=True,
generator = torch.Generator(device='cuda'))
D:\ProgramData\Anaconda3\python.exe D:/code/python/ssd.pytorch/train.py
Loading base network...
Initializing weights...
Loading the dataset...
Training SSD on: VOC0712
Using the specified args:
Namespace(basenet='vgg16_reducedfc.pth', batch_size=32, cuda=True, dataset='VOC', dataset_root='D:\code\python\ssd.pytorch\data/VOCdevkit/', gamma=0.1, lr=0.001, momentum=0.9, num_workers=4, resume=None, save_folder='weights/', start_iter=0, visdom=False, weight_decay=0.0005)
Traceback (most recent call last):
File "D:/code/python/ssd.pytorch/train.py", line 261, in
train()
File "D:/code/python/ssd.pytorch/train.py", line 150, in train
batch_iterator = iter(data_loader)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 359, in iter
return self._get_iterator()
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 305, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 944, in init
self._reset(loader, first_iter=True)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 975, in _reset
self._try_put_index()
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 1209, in _try_put_index
index = self._next_index()
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 512, in _next_index
return next(self._sampler_iter) # may raise StopIteration
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\sampler.py", line 229, in iter
for idx in self.sampler:
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\sampler.py", line 126, in iter
yield from torch.randperm(n, generator=generator).tolist()
RuntimeError: Expected a 'cuda' device type for generator but found 'cpu'
The text was updated successfully, but these errors were encountered: