Closed peiyunju closed 2 years ago
Hi @peiyunju, the error shows that the edge
variable is not correctly loaded. It is highly possible that you have some pairs in the training list file (i.e., train_pair.lst) that are not available (e.g., you remove the image and corresponding edge files to reduce the number of samples but forget to remove those in the list file). Please double check the existence of all the pairs in the training list file.
Traceback (most recent call last): File "hed.py", line 309, in
main()
File "hed.py", line 189, in main
train(train_loader, net, opt, lr_schd, epoch, save_dir=join(output_dir, 'epoch-{}-train'.format(epoch)))
File "hed.py", line 214, in train
for batch_index, (images, edges) in enumerate(tqdm(train_loader)):
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\tqdm\std.py", line 1195, in iter
for obj in iterable:
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next
data = self._next_data()
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\Administrator\anaconda3\envs\37\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "F:\hed\datasets.py", line 43, in getitem
edge = edge[np.newaxis, :, :] # Add one channel at first (CHW).
TypeError: 'NoneType' object is not subscriptable