Skip to content

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. #6

@pablovela5620

Description

@pablovela5620

Trying to run the demo using

python demo.py --gpu 0 --stage param --test_epoch 8

Getting the following error

/home/deeplearning/miniconda3/envs/i2l/bin/python /home/deeplearning/0Dev/repos/I2L-MeshNet_RELEASE/demo/demo.py --gpu 0 --stage param --test_epoch 8
>>> Using GPU: 0
/home/deeplearning/0Dev/repos/I2L-MeshNet_RELEASE/main/../common/utils/smplpytorch/smplpytorch/pytorch/smpl_layer.py:41: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at  /opt/conda/conda-bld/pytorch_1595629395347/work/torch/csrc/utils/tensor_numpy.cpp:141.)
  torch.Tensor(smpl_data['betas'].r).unsqueeze(0))
Load checkpoint from /home/deeplearning/0Dev/repos/I2L-MeshNet_RELEASE/output/model_dump/h36_smpl/snapshot_8.pth.tar
Traceback (most recent call last):
  File "/home/deeplearning/0Dev/repos/I2L-MeshNet_RELEASE/demo/demo.py", line 96, in <module>
    out = model(inputs, targets, meta_info, 'test')
  File "/home/deeplearning/miniconda3/envs/i2l/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/deeplearning/miniconda3/envs/i2l/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 153, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/home/deeplearning/miniconda3/envs/i2l/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "../main/model.py", line 76, in forward
    pose_param, shape_param = self.param_regressor(joint_img_from_mesh.detach())
  File "/home/deeplearning/miniconda3/envs/i2l/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/deeplearning/0Dev/repos/I2L-MeshNet_RELEASE/main/../common/nets/module.py", line 124, in forward
    pose = tgm.rotation_matrix_to_angle_axis(pose).reshape(-1,72)
  File "/home/deeplearning/miniconda3/envs/i2l/lib/python3.8/site-packages/torchgeometry/core/conversions.py", line 233, in rotation_matrix_to_angle_axis
    quaternion = rotation_matrix_to_quaternion(rotation_matrix)
  File "/home/deeplearning/miniconda3/envs/i2l/lib/python3.8/site-packages/torchgeometry/core/conversions.py", line 302, in rotation_matrix_to_quaternion
    mask_c1 = mask_d2 * (1 - mask_d0_d1)
  File "/home/deeplearning/miniconda3/envs/i2l/lib/python3.8/site-packages/torch/tensor.py", line 396, 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.

Process finished with exit code 1

I thought maybe it had something to do with the models not having write permission, but I made sure to change that and still encounter this. Anyone else seen this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions