noah-research icon indicating copy to clipboard operation
noah-research copied to clipboard

RuntimeError: Subtraction, the `-` operator, with a bool tensor is not supported. If you are trying to invert a mask, use the `~` or `logical_not()` operator instead.

Open hoangtnm opened this issue 1 year ago • 2 comments

Hi, I'm trying to run sh scripts/run_demo.sh with torch==1.13.1 and torchgeometry== 0.1.2 but I got this error:

Input path: data/test_samples/lspet_samples
Input type: folder
Loading images ...
100% 17/17 [00:00<00:00, 118.60it/s]
Image number: 17
--------------------------- Detection ---------------------------
Load the yolo_v3 checkpoint from path: /content/noah-research/CLIFF/lib/../data/ckpt/yolov3.weights
100% 1/1 [00:00<00:00,  1.38it/s]
--------------------------- 3D HPS estimation ---------------------------
Load the CLIFF checkpoint from path: data/ckpt/hr48-PA43.0_MJE69.0_MVE81.2_3dpw.pt
  0% 0/2 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "demo.py", line 265, in <module>
    main(args)
  File "demo.py", line 151, in main
    pred_pose = tgm.rotation_matrix_to_angle_axis(rotmat).contiguous().view(-1, 72)  # N*72
  File "/usr/local/lib/python3.8/dist-packages/torchgeometry/core/conversions.py", line 233, in rotation_matrix_to_angle_axis
    quaternion = rotation_matrix_to_quaternion(rotation_matrix)
  File "/usr/local/lib/python3.8/dist-packages/torchgeometry/core/conversions.py", line 302, in rotation_matrix_to_quaternion
    mask_c1 = mask_d2 * (1 - mask_d0_d1)
  File "/usr/local/lib/python3.8/dist-packages/torch/_tensor.py", line 31, in wrapped
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/torch/_tensor.py", line 604, in __rsub__
    return _C._VariableFunctions.rsub(self, other)
RuntimeError: Subtraction, the `-` operator, with a bool tensor is not supported. If you are trying to invert a mask, use the `~` or `logical_not()` operator instead.

Do you have any idea why this happens?

hoangtnm avatar Mar 08 '23 15:03 hoangtnm