Closed sunshantong closed 4 years ago
Hi, please refer to Issue#3. No error is because your program is halted by the "try-except" code in the dataloader. You can remove it during the debugging mode.
Hi, please refer to Issue#3. No error is because your program is halted by the "try-except" code in the dataloader. You can remove it during the debugging mode.
Thanks!
@sunshantong May I ask if you have solved this problem? I met the same problem as yours, and after commenting out the try-except, the following errors appear:
6-PACK-master/libs/transformations.py:1912: UserWarning: failed to import module _transformations
warnings.warn('failed to import module %s' % name)
1 1349b2169a97a0ff54e1b6f41fdd78a
1 9b9a4bb5550f00ea586350d6e78ecc7
1 991d9df5bf2a33a1c9292f26f73f6538
1 2fa757f584a3be31a7ceedb2540a32b0
........
5 laptop_alienware_norm
5 laptop_mac_pro_norm
6 mug_daniel_norm
6 mug_anastasia_norm
6 mug_brown_starbucks_norm
/home/xxxx/.local/lib/python3.6/site-packages/torch/nn/functional.py:52: UserWarning: size_average and reduce args will be deprecated, please use reduction='elementwise_mean' instead.
warnings.warn(warning.format(ret))
Traceback (most recent call last):
File "train.py", line 57, in <module>
for i, data in enumerate(dataloader, 0):
File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 336, in __next__
return self._process_next_batch(batch)
File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
KeyError: 'Traceback (most recent call last):\n File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in <listcomp>\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/media/xxxx/921c3f71-709a-4be3-a7fe-e43d2bd2b602/home/xxxx/6-PACK-master/dataset/dataset_nocs.py", line 435, in __getitem__\n choose_obj = random.sample(self.obj_name_list[self.cate_id], 1)[0]\nKeyError: 0\n'
@j96w I am new here, so I would be very appreciated if you have any suggestions on this error, or on how to debug dataloader!! Thanks in advance!
@sunshantong May I ask if you have solved this problem? I met the same problem as yours, and after commenting out the try-except, the following errors appear:
6-PACK-master/libs/transformations.py:1912: UserWarning: failed to import module _transformations warnings.warn('failed to import module %s' % name) 1 1349b2169a97a0ff54e1b6f41fdd78a 1 9b9a4bb5550f00ea586350d6e78ecc7 1 991d9df5bf2a33a1c9292f26f73f6538 1 2fa757f584a3be31a7ceedb2540a32b0 ........ 5 laptop_alienware_norm 5 laptop_mac_pro_norm 6 mug_daniel_norm 6 mug_anastasia_norm 6 mug_brown_starbucks_norm /home/xxxx/.local/lib/python3.6/site-packages/torch/nn/functional.py:52: UserWarning: size_average and reduce args will be deprecated, please use reduction='elementwise_mean' instead. warnings.warn(warning.format(ret)) Traceback (most recent call last): File "train.py", line 57, in <module> for i, data in enumerate(dataloader, 0): File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 336, in __next__ return self._process_next_batch(batch) File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch raise batch.exc_type(batch.exc_msg) KeyError: 'Traceback (most recent call last):\n File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in <listcomp>\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/media/xxxx/921c3f71-709a-4be3-a7fe-e43d2bd2b602/home/xxxx/6-PACK-master/dataset/dataset_nocs.py", line 435, in __getitem__\n choose_obj = random.sample(self.obj_name_list[self.cate_id], 1)[0]\nKeyError: 0\n'
@j96w I am new here, so I would be very appreciated if you have any suggestions on this error, or on how to debug dataloader!! Thanks in advance!
I remember it was caused by the bbox path. Try Changing _bbox_path = (image_path + 'bbox.txt').replace(image_dir,posedir) to _bbox_path = (imagepath + 'bbox.txt') in data_preprocess.py line 70. But I'm not sure it's going to work for the new version of the code. Hope this can help you.
@sunshantong May I ask if you have solved this problem? I met the same problem as yours, and after commenting out the try-except, the following errors appear:
6-PACK-master/libs/transformations.py:1912: UserWarning: failed to import module _transformations warnings.warn('failed to import module %s' % name) 1 1349b2169a97a0ff54e1b6f41fdd78a 1 9b9a4bb5550f00ea586350d6e78ecc7 1 991d9df5bf2a33a1c9292f26f73f6538 1 2fa757f584a3be31a7ceedb2540a32b0 ........ 5 laptop_alienware_norm 5 laptop_mac_pro_norm 6 mug_daniel_norm 6 mug_anastasia_norm 6 mug_brown_starbucks_norm /home/xxxx/.local/lib/python3.6/site-packages/torch/nn/functional.py:52: UserWarning: size_average and reduce args will be deprecated, please use reduction='elementwise_mean' instead. warnings.warn(warning.format(ret)) Traceback (most recent call last): File "train.py", line 57, in <module> for i, data in enumerate(dataloader, 0): File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 336, in __next__ return self._process_next_batch(batch) File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch raise batch.exc_type(batch.exc_msg) KeyError: 'Traceback (most recent call last):\n File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/home/xxxx/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in <listcomp>\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/media/xxxx/921c3f71-709a-4be3-a7fe-e43d2bd2b602/home/xxxx/6-PACK-master/dataset/dataset_nocs.py", line 435, in __getitem__\n choose_obj = random.sample(self.obj_name_list[self.cate_id], 1)[0]\nKeyError: 0\n'
@j96w I am new here, so I would be very appreciated if you have any suggestions on this error, or on how to debug dataloader!! Thanks in advance!
I remember it was caused by the bbox path. Try Changing _bbox_path = (image_path + 'bbox.txt').replace(image_dir,posedir) to _bbox_path = (imagepath + 'bbox.txt') in data_preprocess.py line 70. But I'm not sure it's going to work for the new version of the code. Hope this can help you.
It seems not caused by the path of bbox, but thanks for your answer anyway~
Thank you for your work! When I run sudo python3 train.py, the following happens
home/user/Work/6-PACK/libs/transformations.py:1912: UserWarning: failed to import module _transformations warnings.warn('failed to import module %s' % name) 1 a1c63c463ad7fc1fb549927fbd0d12d 1 73632ddb4a5684503594b3be653e6bff 1 bd6fdeae09b3c00c3ea96ac97db63fa8 1 6444875e3217bf891f5f48a891d827bd 1 1e5abf0465d97d826118a17db9de8c0 1 6b8b2cb01c376064c8724d5673a063a6 1 109d55a137c042f5760315ac3bf2c13e . . . 6 73b8b6456221f4ea20d3c05c08e26f 6 d32cd77c6630b77de47c0353c18d58e 6 b4ae56d6638d5338de671f28c83d2dcb 6 187859d3c3a2fd23f54e1b6f41fdd78a 6 b7e705de46ebdcc14af54ba5738cb1c5 6 34ae0b61b0d8aaf2d7b20fded0142d7a 6 896f1d494bac0ebcdec712af445786fe 1 bottle_starbuck_norm 1 bottle3_scene5_norm 1 bottle_blue_google_norm 2 bowl_blue_ikea_norm 2 bowl_chinese_blue_norm 2 bowl_brown_ikea_norm 3 camera_dslr_wo_len_norm 3 camera_dslr_len_norm 3 camera_anastasia_norm 4 can_tall_yellow_norm 4 can_porridge_norm 4 can_milk_wangwang_norm 5 laptop_air_0_norm 5 laptop_air_1_norm 5 laptop_dell_norm 6 mug_vignesh_norm 6 mug2_scene3_norm 6 mug_white_green_norm 1 bottle_shengjun_norm 1 bottle_red_stanford_norm 1 bottle_shampoo_norm 2 bowl_shengjun_norm 2 bowl_blue_white_chinese_norm 2 bowl_white_small_norm 3 camera_canon_len_norm 3 camera_shengjun_norm 3 camera_canon_wo_len_norm 4 can_green_norm 4 can_lotte_milk_norm 4 can_arizona_tea_norm 5 laptop_air_xin_norm 5 laptop_alienware_norm 5 laptop_mac_pro_norm 6 mug_daniel_norm 6 mug_anastasia_norm 6 mug_brown_starbucks_norm /usr/local/lib/python3.5/dist-packages/torch/nn/functional.py:52: UserWarning: size_average and reduce args will be deprecated, please use reduction='elementwise_mean' instead. warnings.warn(warning.format(ret))
The program has been stopped here and no error has been reported. Can you give me some suggestions? Thank you very much.