jeudi 3 juin 2021

raise TypeError("Invalid comparison of non-real %s" % me) in sympy

I am getting this sympy related comparison error. Do you know how I can fix it? It doesn't seem that authors in the original repo are facing it. I see that for one of the pkl files, namely 001.pkl, the y2d is imaginary (not sure why), and is equal to 1.05147176800692e-6 + 3.72470439655723*I.

I am running this code: https://github.com/DirtyHarryLYL/DJ-RN/blob/master/script/generate_3D_obj_GT.py

(djrn) [jalal@goku DJ-RN-dawnlight]$ python script/generate_3D_obj_GT.py --smplx_path ../../data/smplify-x/models_smplx_v1_1/models/smplx/ --res ../../data/smplify-x/ride_bike/step6_train/ --img_path ../../data/smplify-x/ride_bike/step6_data/images --save_obj_path ../../data/smplify-x/ride_bike/step6_obj
37633
../../data/smplify-x/ride_bike/step6_train/results/HICO_train2015_00004909/000.pkl
y2d 39.9603816459773, obox [9, -85, 93, 5]
y2d -39.9603816587270, obox [9, -85, 93, 5]
y2d 49.9684719529012, obox [9, -85, 93, 5]
y2d -49.9684719656511, obox [9, -85, 93, 5]
../../data/smplify-x/ride_bike/step6_train/results/HICO_train2015_00004909/001.pkl
y2d 1.05147176800692e-6 + 3.72470439655723*I, obox [-231, -89, -138, 89]
Traceback (most recent call last):
  File "script/generate_3D_obj_GT.py", line 95, in <module>
    otri, obj_vertexs = get_param(result, hbox, obox, htri, img, radius, gamma_min, gamma_max)      
  File "/scratch3/research/code/DJ-RN-dawnlight/script/generate_utils.py", line 372, in get_param
    if (((y2D >= obox[1]) & (y2D <= obox[3])) | ((y2D <= obox[1]) & (y2D >= obox[3]))):
  File "/scratch3/venv/djrn/lib/python3.8/site-packages/sympy/core/expr.py", line 393, in __ge__
    return self._cmp(other, ">=", GreaterThan)
  File "/scratch3/venv/djrn/lib/python3.8/site-packages/sympy/core/expr.py", line 346, in _cmp
    raise TypeError("Invalid comparison of non-real %s" % me)
TypeError: Invalid comparison of non-real 1.05147176800692e-6 + 3.72470439655723*I

Aucun commentaire:

Enregistrer un commentaire