3D-FRONT-FUTURE / 3D-FRONT-ToolBox

93 stars 19 forks source link

Error while trying to train models for the scene synthesis example #13

Open fathyshalaby opened 3 years ago

fathyshalaby commented 3 years ago

remote@pop-os:~/repos/autofurnish/external_experiments/scene_synthesis/deep_synth$ python continue_train.py --data-dir bedroom --save-dir bedroom --train-size 160 --use-count Building model... Converting to CUDA... Building dataset... Building data loader... Building optimizer... =========================== Epoch 0 =========================== torch.Size([188, 47]) 54 132 torch.Size([49, 28]) 337 159 torch.Size([202, 202]) 148 344 torch.Size([49, 39]) 441 358 torch.Size([45, 46]) 111 118 torch.Size([4, 56]) 226 173 torch.Size([195, 181]) 175 159 torch.Size([40, 40]) 53 207 torch.Size([185, 202]) 73 152 torch.Size([172, 33]) 329 398 torch.Size([176, 57]) 211 81 torch.Size([2, 2]) 153 225 torch.Size([121, 54]) 77 157 torch.Size([45, 47]) 332 117 torch.Size([163, 182]) 397 358 torch.Size([39, 43]) 393 370 torch.Size([49, 28]) 160 163 torch.Size([183, 201]) 154 108 torch.Size([49, 132]) 434 163 Traceback (most recent call last): File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/continue_train.py", line 206, in train() File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/continue_train.py", line 136, in train torch.Size([35, 39]) 131 252 for batch_idx, (data, target, existing) in enumerate(train_loader): File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/.venv_furnish/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 521, in next torch.Size([51, 183]) 430 117 data = self._next_data() File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/.venv_furnish/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data return self._process_data(data) File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/.venv_furnish/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data data.reraise() File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/.venv_furnish/lib/python3.9/site-packages/torch/_utils.py", line 425, in reraise raise self.exc_type(msg) RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/.venv_furnish/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/.venv_furnish/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/.venv_furnish/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/continue_dataset.py", line 63, in getitem composite.add_node(node) File "/home/remote/repos/autofurnish/external_experiments/scene_synthesis/deep_synth/data/rendered.py", line 189, in add_node to_add[xmin:xmin+xsize,ymin:ymin+ysize] = h RuntimeError: The expanded size of the tensor (168) must match the existing size (202) at non-singleton dimension 1. Target sizes: [202, 168]. Tensor sizes: [202, 202]

fathyshalaby commented 3 years ago

Could you please tell me which train_size was used or what could be the problem as I followed the README.md exactly.

fathyshalaby commented 3 years ago

After some research I found out that there seems to be a problem in the data generation script as the error in rendered.py is thrown as the h.shape!=to_add[xmin:xmin+xsize,ymin:ymin+ysize].shape, which means that the height map or the bbox are calculated wrong for some of the samples. Could you please tell me if this seems to be correct? Are all the scripts up to date as I did notice that there seem to still be some traces of testing in the create_data.py. 408

jwzxgy2007 commented 3 years ago

Hi fathyshalaby, sorry for the late reply. Because the 3D-FRONT has been updated several versions, and some definition in json file was changed. This code is modified from the original one, I will check the create_data.py.

Isanaz commented 2 years ago

Hi there, I met the same question when training it. My solution is to simply drop the pixels of the object outside the range, I don't know if it is reasonable?