YangHai-1218 / PseudoFlow

Pseudo Flow Consistency for Self-Supervised 6D Object Pose Estimation (ICCV 2023)
Apache License 2.0
28 stars 3 forks source link

Errors when running optical flow training command #4

Open jfitzg7 opened 10 months ago

jfitzg7 commented 10 months ago

Hi @YangHai-1218,

I ran into an error when running the command python train.py --config configs/flow_refine/raft_flow_mask.py --mode refiner:

/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
  warnings.warn(
2023-12-25 13:53:49,061 - Flow-6D - INFO - Distributed training: False
2023-12-25 13:53:49,140 - mmcv - INFO - initialize RAFTRefinerFlowMask with init_cfg {'type': 'Pretrained', 'checkpoint': 'work_dirs/raft_8x2_100k_flyingthings3d_400x720_convertered.pth'}
2023-12-25 13:53:49,140 - mmcv - INFO - load model from: work_dirs/raft_8x2_100k_flyingthings3d_400x720_convertered.pth
2023-12-25 13:53:49,141 - mmcv - INFO - load checkpoint from local path: work_dirs/raft_8x2_100k_flyingthings3d_400x720_convertered.pth
Traceback (most recent call last):
  File "/data2/6d-pose-estimation/PseudoFlow/PseudoFlow/train.py", line 129, in <module>
    model.init_weights()
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/runner/base_module.py", line 106, in init_weights
    initialize(self, self.init_cfg)
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/cnn/utils/weight_init.py", line 636, in initialize
    _initialize(module, cp_cfg)
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/cnn/utils/weight_init.py", line 539, in _initialize
    func(module)
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/cnn/utils/weight_init.py", line 509, in __call__
    load_checkpoint(
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/runner/checkpoint.py", line 638, in load_checkpoint
    checkpoint = _load_checkpoint(filename, map_location, logger)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/runner/checkpoint.py", line 572, in _load_checkpoint
    return CheckpointLoader.load_checkpoint(filename, map_location, logger)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/runner/checkpoint.py", line 314, in load_checkpoint
    return checkpoint_loader(filename, map_location)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/runner/checkpoint.py", line 333, in load_from_local
    raise FileNotFoundError(f'{filename} can not be found.')
FileNotFoundError: work_dirs/raft_8x2_100k_flyingthings3d_400x720_convertered.pth can not be found

Do we need this checkpoint file (raft_8x2_100k_flyingthings3d_400x720_convertered.pth) to be there? I assumed it isn't required, so I just commented out the line in configs/flow_refine/raft_flow_mask.py that was loading it in. But then I ran into this error:

Traceback (most recent call last):
  File "/data2/6d-pose-estimation/PseudoFlow/PseudoFlow/train.py", line 142, in <module>
    model = MMDataParallel(model.cuda(gpu_ids[0]), device_ids=gpu_ids)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/mmcv/parallel/data_parallel.py", line 36, in __init__
    super().__init__(*args, dim=dim, **kwargs)
  File "/home/jack/anaconda3/envs/pseudoflow-3.11/lib/python3.11/site-packages/torch/nn/parallel/data_parallel.py", line 148, in __init__
    self.module.to(self.src_device_obj)
  File "/data2/6d-pose-estimation/PseudoFlow/PseudoFlow/models/refiner/base_refiner.py", line 80, in to
    self.renderer.to(device)
  File "/data2/6d-pose-estimation/PseudoFlow/PseudoFlow/models/utils/rendering.py", line 119, in to
    self.meshes[k] = self.meshes[k].to(device)
                     ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'to'

Do you have any suggestions on how to go about resolving this error?