ejones / triposr-texture-gen

Generates a texture for 3D models created by the TripoSR image-to-3D model
MIT License
82 stars 10 forks source link

Please help #3

Open al3dv2 opened 3 months ago

al3dv2 commented 3 months ago

I have a error : (textureautovenv) (base) C:\pinokio\api\triposr.git\app>python text2texture.py .\output\catgirl.obj "catgirl"

processing mesh

computing UV atlas for 9999 triangles [Open3D INFO] actual parallel_partitions 3 saving depth map at output\mesh-preproc-depth.png

'C:\pinokio\api\triposr.git\app\depth_txt2img.py' catgirl 'output\mesh-preproc-depth.png' 'output\mesh-preproc-depth-paint.png' --steps 12 --image-model 'SG161222\Realistic_Vision_V5.1_noVAE' Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python Python runtime state: preinitialized

Traceback (most recent call last): File "C:\pinokio\api\triposr.git\app\text2texture.py", line 329, in tmesh = text2texture( File "C:\pinokio\api\triposr.git\app\text2texture.py", line 258, in text2texture subprocess.run( File "C:\pinokio\bin\miniconda\lib\subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['C:\pinokio\api\triposr.git\app\textureautovenv\Scripts\python.exe', 'C:\pinokio\api\triposr.git\app\depth_txt2img.py', 'catgirl', 'output\mesh-preproc-depth.png', 'output\mesh-preproc-depth-paint.png', '--steps', '12', '--image-model', 'SG161222\Realistic_Vision_V5.1_noVAE']' returned non-zero exit status 1.

ejones commented 2 months ago

Hm, haven't seen that one, I can look into it. If it happens to be related to Windows, though, I'm not sure when I will have a chance to test it cross-platform. So far I've just been developing on the Mac.

albozes commented 2 months ago

I have this same error on Windows. If it's fixed this would prove incredibly helpful to the SD community - can I help you test it somehow?

albozes commented 2 months ago

I was able to get one step further. Windows doesn't seem to like Python opening up an instance of itself, as described here.

To fix the error, I tried this in text2texture.py:

new_env = os.environ.copy()
subprocess.run(
    [sys.executable, *depth_paint_args],
    check=True,
    # env={'PYTORCH_ENABLE_MPS_FALLBACK': '1'},
    env=new_env,
)

It got me a little bit deeper in the process to a totally different error, so I think it may fix this particular Windows issue.