Open lorylei opened 5 years ago
Hello @lorylei , have you figure out how to deal with this issue? I faced the same error when I try to use mini-vg dataset....
This is because the length of "im_h5["image_widths"]" in https://github.com/jwyang/graph-rcnn.pytorch/blob/0f294ecb86d5f130e82ee85246b6afd5180240e5/lib/data/vg_hdf5.py#L243 is 108,072, while its index "split_mask" has 108,073 elements. Thus, change:
im_widths = im_h5["image_widths"][split_mask] im_heights = im_h5["image_heights"][split_mask]
to
im_widths = im_h5["image_widths"][split_mask[:-1]] im_heights = im_h5["image_heights"][split_mask[:-1]]
would be a workaround
File "/home/vkmtrddy/Graph-RCNN-master/main.py", line 133, in
File "main.py", line 127, in
main()
File "main.py", line 122, in main
model = train(cfg, args)
File "main.py", line 68, in train
model = build_model(cfg, arguments, args.local_rank, args.distributed)
File "/data2/linbingqian/test/graph-rcnn/lib/model.py", line 307, in build_model
return SceneGraphGeneration(cfg, arguments, local_rank, distributed)
File "/data2/linbingqian/test/graph-rcnn/lib/model.py", line 31, in init
self.data_loader_train = build_data_loader(cfg, split="train", is_distributed=distributed)
File "/data2/linbingqian/test/graph-rcnn/lib/data/build.py", line 60, in build_data_loader
dataset = vg_hdf5(cfg, split=split, transforms=transforms, num_im=num_im)
File "/data2/linbingqian/test/graph-rcnn/lib/data/vg_hdf5.py", line 56, in init
filter_non_overlap=filter_non_overlap and split == "train",
File "/data2/linbingqian/test/graph-rcnn/lib/data/vg_hdf5.py", line 243, in load_graphs
im_widths = im_h5["image_widths"][split_mask]
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/home/linbingqian/anaconda3/envs/grcnn/lib/python3.7/site-packages/h5py/_hl/dataset.py", line 553, in getitem
selection = sel.select(self.shape, args, dsid=self.id)
File "/home/linbingqian/anaconda3/envs/grcnn/lib/python3.7/site-packages/h5py/_hl/selections.py", line 72, in select
sel[arg]
File "/home/linbingqian/anaconda3/envs/grcnn/lib/python3.7/site-packages/h5py/_hl/selections.py", line 214, in getitem
raise TypeError("Boolean indexing array has incompatible shape")
how to deal with such circumustance?