lzccccc / SMOKE

SMOKE: Single-Stage Monocular 3D Object Detection via Keypoint Estimation
MIT License
696 stars 177 forks source link

Different imagesize #42

Open chinnikrishna55 opened 3 years ago

chinnikrishna55 commented 3 years ago

Hi,

I have dataset with different image size. And its larger so I an resizing to smaller image. WHat changes needs to be done to make the code work correctly. I have changed the intrinsic matrix when resizing image accordingly. But results are bad. What other changes are needed?

dantp-ai commented 3 years ago

@chinnikrishna55 How did you re-calculate the intrinsic matrix with the new custom image size? Any other changes you needed to do to get it working?

nikhil-nakhate commented 3 years ago

Hi @chinnikrishna55, I tried with a custom dataset and did some resizing on the image. The number of classes are also different. The training starts but then I get the following error. Did you also face the same issue:

/opt/conda/conda-bld/pytorch_1573049306803/work/aten/src/ATen/native/cuda/IndexKernel.cu:60: lambda ->auto::operator()(int)->auto: block: [0,0,0], thread: [9,0,0] Asserti on index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed. /opt/conda/conda-bld/pytorch_1573049306803/work/aten/src/ATen/native/cuda/IndexKernel.cu:60: lambda ->auto::operator()(int)->auto: block: [0,0,0], thread: [10,0,0] Assert ion index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed. /opt/conda/conda-bld/pytorch_1573049306803/work/aten/src/ATen/native/cuda/IndexKernel.cu:60: lambda ->auto::operator()(int)->auto: block: [0,0,0], thread: [11,0,0] Assert ion index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed. Traceback (most recent call last): File "tools/plain_train_net.py", line 100, in args=(args,), File "/home/nnn/3D_detection/SMOKE/smoke/engine/launch.py", line 56, in launch main_func(args) File "tools/plain_train_net.py", line 88, in main train(cfg, model, device, distributed) File "tools/plain_train_net.py", line 53, in train arguments File "/home/nnn/3D_detection/SMOKE/smoke/engine/trainer.py", line 66, in do_train loss_dict = model(images, targets) File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(input, *kwargs) File "/home/nnn/3D_detection/SMOKE/smoke/modeling/detector/keypoint_detector.py", line 37, in forward result, detector_losses = self.heads(features, targets) File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(input, **kwargs) File "/home/nnn/3D_detection/SMOKE/smoke/modeling/heads/smoke_head/smoke_head.py", line 22, in forward loss_heatmap, loss_regression = self.loss_evaluator(x, targets) File "/home/nnn/3D_detection/SMOKE/smoke/modeling/heads/smoke_head/loss.py", line 117, in call predict_boxes3d = self.prepare_predictions(targets_variables, pred_regression) File "/home/nnn/3D_detection/SMOKE/smoke/modeling/heads/smoke_head/loss.py", line 79, in prepare_predictions targets_variables["flip_mask"] File "/home/nnn/3D_detection/SMOKE/smoke/modeling/smoke_coder.py", line 219, in decode_orientation cos_pos_idx = (vector_ori[:, 1] >= 0).nonzero() RuntimeError: copy_if failed to synchronize: cudaErrorAssert: device-side assert triggered

yqchau commented 3 years ago

hi have you resolved this problem? I am facing similar issues.

nikhil-nakhate commented 3 years ago

Hey! Yes I have resolved this. There is a matrix in one of the config files that has the approximate sizes of different class of objects. If you have more classes than 3, It throws an error.

yqchau commented 3 years ago

Hey, do you mind sharing how you resolve it then?

LordonCN commented 1 year ago

Hey, do you mind sharing how you resolve it then?

change _C.MODEL.SMOKE_HEAD.DIMENSION_REFERENCE in defaults.py