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

TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class 'NoneType'> #95

Open
hark001 opened this issue Oct 26, 2021 · 0 comments

Comments

@hark001
Copy link

hark001 commented Oct 26, 2021

Hello everyone,

I'm trying to evaluate using the available trained model (LINEMOD dataset) on pyTorch 1.5 . I have downloaded the datasets from deep fusion and linked the datasets to pvn3d/datasets/linemod/Linemod_preprocessed . I have followed the necessary steps for inferencing. While executing, I got this error from yaml.load requesting for another argument. I'm able to overcome the error by using yaml.safe_load.

Now I'm struck at another error which I'm not able to resolve. Any help is much appreciated. Thank you.

loading pretrained mdl.
==> Loading from checkpoint 'train_log/linemod/checkpoints/ape/ape_pvn3d_best.pth.tar'
==> Done
test_loader size: 1050
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/harish/harish/PVN3D/pvn3d/demo.py", line 190, in
main()
File "/home/harish/harish/PVN3D/pvn3d/demo.py", line 183, in main
for i, data in tqdm.tqdm(
File "/home/harish/.virtualenvs/pvn3d/lib/python3.8/site-packages/tqdm/std.py", line 1180, in iter
for obj in iterable:
File "/home/harish/.virtualenvs/pvn3d/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 345, in next
data = self._next_data()
File "/home/harish/.virtualenvs/pvn3d/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data
return self._process_data(data)
File "/home/harish/.virtualenvs/pvn3d/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data
data.reraise()
File "/home/harish/.virtualenvs/pvn3d/lib/python3.8/site-packages/torch/_utils.py", line 395, in reraise
raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/harish/.virtualenvs/pvn3d/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/harish/.virtualenvs/pvn3d/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/home/harish/.virtualenvs/pvn3d/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 81, in default_collate
raise TypeError(default_collate_err_msg_format.format(elem_type))
TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class 'NoneType'>

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

1 participant