abdallahdib / NextFace

A high-fidelity 3D face reconstruction library from monocular RGB image(s)
GNU General Public License v3.0
715 stars 92 forks source link

RuntimeError: Boolean value of Tensor with more than one value is ambiguous #71

Open tombenj opened 1 year ago

tombenj commented 1 year ago

Trying to run the replay.py animation but I'm getting the below error:

loading optim config from:  ./optimConfig.ini
Loading Basel Face Model 2017 from ./baselMorphableModel/morphableModel-2017.pickle...
loading mesh normals...
loading uv parametrization...
loading landmarks association file...
creating sampler...
/usr/local/lib/python3.10/dist-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
animating reconstruction, this may take some time depending on the number of raytracing samples and ur gpu. please wait...
Traceback (most recent call last):
  File "/content/NextFace/new_replay.py", line 62, in <module>
    while currentAngle > minBound:
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
tombenj commented 1 year ago

Just to clarify, this happens when more than one image is used for a person. So the replay.py script doesn't work if you have constructed a face/person using more than one image using --sharedIdentity.

hipro commented 1 year ago

Encountered this problem as well.

loading optim config from:  ./optimConfig.ini
Loading Basel Face Model 2017 from ./baselMorphableModel/morphableModel-2017.pickle...
loading mesh normals...
loading uv parametrization...
loading landmarks association file...
creating sampler...
animating reconstruction, this may take some time depending on the number of raytracing samples and ur gpu. please wait...
Traceback (most recent call last):
  File "replay.py", line 63, in <module>
    while currentAngle > minBound:
RuntimeError: bool value of Tensor with more than one value is ambiguous