j96w/DenseFusion

Cant train on custom dataset

Closed this issue · 1 comments

Hi,
I saw in the different issues that people are able to train on their custom dataset. Is it possible to provide details on what to modify in order to do so ? I already applied some modification such as lowering the num_points.
Here is the error log.
Please let me know if i need to provide additional information.

2022-04-14 16:32:44,797 : Train time 00h 00m 00s, Training started
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/halodi/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/main.py", line 45, in <module>
cli.main()
File "/home/halodi/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
run()
File "/home/halodi/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("main"))
File "/usr/lib/python3.8/runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/halodi/ros_ws/src/halodi-segmentation/halodi_segmentation/train_DenseFusion.py", line 237, in <module>
main()
File "/home/halodi/ros_ws/src/halodi-segmentation/halodi_segmentation/train_DenseFusion.py", line 131, in main
for i, data in enumerate(dataloader, 0):
File "/home/halodi/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/home/halodi/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/home/halodi/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/home/halodi/.local/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/halodi/.local/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/home/halodi/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/halodi/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/halodi/ros_ws/src/halodi-segmentation/halodi_segmentation/models/DenseFusion/datasets/linemod/dataset.py", line 116, in getitem
mask_label = ma.getmaskarray(ma.masked_equal(label, np.array([255, 255, 255])))[:, :, 0]
File "/home/halodi/.local/lib/python3.8/site-packages/numpy/ma/core.py", line 2098, in masked_equal
output = masked_where(equal(x, value), x, copy=copy)
File "/home/halodi/.local/lib/python3.8/site-packages/numpy/ma/core.py", line 1013, in call
result = self.f(da, db, *args, **kwargs)
ValueError: operands could not be broadcast together with shapes (540,960,4) (3,)

@an99990
Were you able to solve this problem?
I am getting a similar error when I use my own custom dataset.

Also, do you happen to know how to get the Segmentation Results from the trained network?

Thank you!