Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING:root:NaN or Inf found in input tensor. #209

Open
FengHaobo opened this issue Nov 30, 2021 · 1 comment
Open

WARNING:root:NaN or Inf found in input tensor. #209

FengHaobo opened this issue Nov 30, 2021 · 1 comment

Comments

@FengHaobo
Copy link

When I use my own data set, the loss appears nan, and it reports WARNING:root:NaN or Inf found in input tensor. What is the reason?

**Traceback (most recent call last):
File "train.py", line 114, in
main()
File "train.py", line 105, in main
model = train(cfg, args)
File "train.py", line 44, in train
model = do_train(cfg, model, train_loader, optimizer, scheduler, checkpointer, device, arguments, args)
File "D:\Document\PersonalDocuments\FileCollection\All_Programs\Python\MyPaperExperiment\lufficc\original\SSD-master\ssd\engine\trainer.py", line
76, in do_train
for iteration, (images, targets, _) in enumerate(data_loader, start_iter):
File "D:\Software\ProgrammingTools\Anaconda\envs\torch1.6\lib\site-packages\torch\utils\data\dataloader.py", line 363, in next
data = self._next_data()
File "D:\Software\ProgrammingTools\Anaconda\envs\torch1.6\lib\site-packages\torch\utils\data\dataloader.py", line 989, in _next_data
return self._process_data(data)
File "D:\Software\ProgrammingTools\Anaconda\envs\torch1.6\lib\site-packages\torch\utils\data\dataloader.py", line 1014, in _process_data
data.reraise()
File "D:\Software\ProgrammingTools\Anaconda\envs\torch1.6\lib\site-packages\torch_utils.py", line 395, in reraise
raise self.exc_type(msg)
cv2.error: Caught error in DataLoader worker process 1.
Original Traceback (most recent call last):
File "D:\Software\ProgrammingTools\Anaconda\envs\torch1.6\lib\site-packages\torch\utils\data_utils\worker.py", line 185, in _worker_loop
data = fetcher.fetch(index)
File "D:\Software\ProgrammingTools\Anaconda\envs\torch1.6\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\Software\ProgrammingTools\Anaconda\envs\torch1.6\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\Document\PersonalDocuments\FileCollection\All_Programs\Python\MyPaperExperiment\lufficc\original\SSD-master\ssd\data\datasets\voc.py", l
ine 44, in getitem
image, boxes, labels = self.transform(image, boxes, labels)
File "D:\Document\PersonalDocuments\FileCollection\All_Programs\Python\MyPaperExperiment\lufficc\original\SSD-master\ssd\data\transforms\transfor
ms.py", line 75, in call
img, boxes, labels = t(img, boxes, labels)
File "D:\Document\PersonalDocuments\FileCollection\All_Programs\Python\MyPaperExperiment\lufficc\original\SSD-master\ssd\data\transforms\transfor
ms.py", line 135, in call
self.size))
cv2.error: OpenCV(4.5.4) 👎 error: (-5:Bad argument) in function 'resize'

Overload resolution failed:

  • Conversion error: src
  • Expected Ptrcv::UMat for argument 'src'**
@glt999
Copy link

glt999 commented Apr 19, 2022

Have you solved it? I also encountered this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants