3dlg-hcvc / OPDMulti

MIT License
16 stars 3 forks source link

Regarding Pre-trained Model #4

Open anas-zafar opened 9 months ago

anas-zafar commented 9 months ago

@Sun-XH I had question regarding the OPD Real pretrained model that you have provided. Was this model trained on OPD Synthetic first and then finetuned on OPD Real? I am looking to train Opdformer on OPD Real. Thanks

anas-zafar commented 9 months ago

I am facing an error when I try to train opdformer on OPD Real. Please guide me if I am doing something wrong. Thanks python train.py --config-file /opdformer/configs/opd_o_real.yaml --output-dir training_output --data-path dataset/OPD/dataset/MotionDataset_h5_real --input-format RGBD --model_attr_path OPD/dataset/MotionDataset_h5_real/real-attr.json

Sun-XH commented 9 months ago

Hi, @anas-zafar. The provided OPD Real model is trained using this repo. Note that the config file we provided is only for OPDMulit dataset. But training will not fail if you use this config file. Can you show me the error you meet? Then I can help you to check what the error is and provide some suggestions.

anas-zafar commented 9 months ago

Below is the error I am facing

[01/16 07:35:06 d2.engine.hooks]: Total training time: 0:00:04 (0:00:00 on hooks)
[01/16 07:35:06 d2.utils.events]:  iter: 0    lr: N/A  max_mem: 178M
Traceback (most recent call last):
  File "train.py", line 179, in <module>
    args=(args,),
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/engine/launch.py", line 82, in launch
    main_func(*args)
  File "train.py", line 165, in main
    return trainer.train()
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/engine/defaults.py", line 484, in train
    super().train(self.start_iter, self.max_iter)
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/engine/train_loop.py", line 149, in train
    self.run_step()
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/engine/defaults.py", line 494, in run_step
    self._trainer.run_step()
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/engine/train_loop.py", line 391, in run_step
    data = next(self._data_loader_iter)
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/data/common.py", line 234, in __iter__
    for d in self.dataset:
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
    data = self._next_data()
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
    return self._process_data(data)
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
    data.reraise()
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/torch/_utils.py", line 434, in reraise
    raise exception
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch
    data.append(next(self.dataset_iter))
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/data/common.py", line 201, in __iter__
    yield self.dataset[idx]
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/data/common.py", line 90, in __getitem__
    data = self._map_func(self._dataset[cur_idx])
  File "/home/ubuntu/anaconda3/envs/opdmulti_O/lib/python3.7/site-packages/detectron2/utils/serialize.py", line 26, in __call__
    return self._obj(*args, **kwargs)
  File "/home/research/OPDMulti/opdformer/mask2former/data/motion_dataset_mapper.py", line 291, in __call__
    object_poses=self.object_poses
  File "/home/research/OPDMulti/opdformer/mask2former/data/motion_dataset_mapper.py", line 109, in f
    object_poses=object_poses
  File "/home/research/OPDMulti/opdformer/mask2former/data/motion_dataset_mapper.py", line 361, in bm_annotations_to_instances
    [extrinsic_matrix] * len(annos), dtype=torch.float32
TypeError: len() of unsized object
anas-zafar commented 9 months ago

@Sun-XH I have checked the environment I think its fine. I am still facing the above issue. Could you provide some guidelines how to fix it? Thanks