Closed jtydhr88 closed 2 weeks ago
I had a go getting this working under Windows too. For my setup I am supporting CUDA 11.8 and Python 3.10.x because that is what I use for all the AI/ML scripts in Visions of Chaos.
This is my install.bat file. Save to an empty directory (in my case D:\Tests\Unique3D) and run it command line to install Unique3D automatically.
@echo off
echo *** Deleting Unique3D directory if it exists
if exist Unique3D\. rd /S /Q Unique3D
echo *** Cloning Unique3D repository
git clone https://huggingface.co/spaces/Wuvin/Unique3D
cd Unique3D
echo *** Creating venv
python -m venv venv
call venv\scripts\activate.bat
python -m pip install --upgrade pip
pip install torch torchvision torchaudio xformers --index-url https://download.pytorch.org/whl/cu118
pip install https://softology.pro/wheels/triton-2.1.0-cp310-cp310-win_amd64.whl
pip install ninja
pip install diffusers==0.27.2
pip install grpcio werkzeug tensorboard-data-server
echo *** Removing linux specific packages from requirements.txt
type requirements.txt | findstr /v pytorch3d > stripped.txt
del requirements.txt
ren stripped.txt requirements.txt
type requirements.txt | findstr /v ort-nightly > stripped.txt
del requirements.txt
ren stripped.txt requirements.txt
type requirements.txt | findstr /v onnxruntime > stripped.txt
del requirements.txt
ren stripped.txt requirements.txt
type requirements.txt | findstr /v torch-scatter > stripped.txt
del requirements.txt
ren stripped.txt requirements.txt
type requirements.txt | findstr /v diffusers > stripped.txt
del requirements.txt
ren stripped.txt requirements.txt
type requirements.txt | findstr /v xformers > stripped.txt
del requirements.txt
ren stripped.txt requirements.txt
type requirements.txt | findstr /v torch > stripped.txt
del requirements.txt
ren stripped.txt requirements.txt
echo *** Installing requirments.txt
pip install -r requirements.txt
echo *** Installing other required packages
pip uninstall -y xformers
pip install --no-cache-dir --ignore-installed --force-reinstall --no-warn-conflicts xformers==0.0.25 --index-url https://download.pytorch.org/whl/cu118
pip uninstall -y torch
pip uninstall -y torch
pip install --no-cache-dir --ignore-installed --force-reinstall --no-warn-conflicts torch==2.2.1+cu118 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip uninstall onnxruntime
pip uninstall onnxruntime-gpu
pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
pip install ort-nightly-gpu
pip install https://files.pythonhosted.org/packages/b2/3c/6205090507ea96e6e56d0deda8d0fc4c507026ef3772e55b637a5d0b7c61/spaces-0.28.3-py3-none-any.whl
call venv\scripts\deactivate.bat
cd ..
echo *** Finished Unique3D install
echo.
Once the install finishes I try running
python gradio_app\gradio_local.py --port 7860
which gives this error
Traceback (most recent call last):
File "D:\Tests\Unique3D\Unique3D\gradio_app\gradio_local.py", line 20, in <module>
from gradio_app.gradio_3dgen import create_ui as create_3d_ui
File "D:\Tests\Unique3D\Unique3D\.\gradio_app\gradio_3dgen.py", line 1, in <module>
import spaces
ModuleNotFoundError: No module named 'spaces'
After pip install spaces
and rerunning it I get
python gradio_app\gradio_local.py --port 7860
Traceback (most recent call last):
File "D:\Tests\Unique3D\Unique3D\gradio_app\gradio_local.py", line 20, in <module>
from gradio_app.gradio_3dgen import create_ui as create_3d_ui
File "D:\Tests\Unique3D\Unique3D\.\gradio_app\gradio_3dgen.py", line 1, in <module>
import spaces
File "D:\Tests\Unique3D\Unique3D\venv\lib\site-packages\spaces\__init__.py", line 10, in <module>
from .zero.decorator import GPU
File "D:\Tests\Unique3D\Unique3D\venv\lib\site-packages\spaces\zero\decorator.py", line 21, in <module>
from .wrappers import regular_function_wrapper
File "D:\Tests\Unique3D\Unique3D\venv\lib\site-packages\spaces\zero\wrappers.py", line 15, in <module>
from multiprocessing.context import ForkProcess
ImportError: cannot import name 'ForkProcess' from 'multiprocessing.context' (D:\Python\lib\multiprocessing\context.py)
ForkProcess seems to be Linux only so no go for me. If we can get a single click install.bat working that would really help Windows users (and me so I can add support for Unique3D into Visions of Chaos).
bump
Hey! Welcome to 4D digital art creation universe—— Aiuni.
🤖First, join our community by: https://discord.gg/aiuni
🦄️Then you will get the invitation code at “getting-started” channel.
Start your creative journey and have fun!🌟
From: @.> Date: Sat, Jun 15, 2024, 4:23 AM Subject: Re: [AiuniAI/Unique3D] For Windows users (Issue #15) To: @.> Cc: @.> bump — Reply to this email directly, view it on GitHubhttps://github.com/AiuniAI/Unique3D/issues/15#issuecomment-2168712192, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BI3NO5RD3VCI4QZO2WZX2ODZHNGKXAVCNFSM6AAAAABJAOPC56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRYG4YTEMJZGI. You are receiving this because you are subscribed to this thread.[image: https://github.com/notifications/beacon/BI3NO5QIEWXNSVVCHOWHMPLZHNGKXA5CNFSM6AAAAABJAOPC56WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUBIPWAA.gif]Message ID: @.>
for autodownload (unique3d-py311) E:\Unique3D>pip show torch Name: torch Version: 2.3.0+cu121 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org/ Author: PyTorch Team Author-email: packages@pytorch.org License: BSD-3 Location: C:\Users\WS01\anaconda3\envs\unique3d-py311\Lib\site-packages Requires: filelock, fsspec, jinja2, mkl, networkx, sympy, typing-extensions Required-by: torchaudio, torchvision, xformers
(unique3d-py311) E:\Unique3D> then .... Failed to build pytorch3d ERROR: Could not build wheels for pytorch3d, which is required to install pyproject.toml-based projects
how to deal with this problem...
I got it working on my Windows. It might require Visual Studio Build Tools. However, I am not sure because my local already installed previously. If it needs, you can find from Visual Studio Build Tools.
Env
Setup Steps
Runtime
you need to create the output folder tmp\gradio under the running driver by yourself, for me, it is F:\tmp\gradio
You will see the error of onnxruntime
but it would not effect the generation of the mesh (maybe?)
Quick test
![image](https://github.com/AiuniAI/Unique3D/assets/860985/fa34f3a1-37af-488f-8b2f-1c0fe2329256)
Good luck~