Zheng-Chong / CatVTON

CatVTON is a simple and efficient virtual try-on diffusion model with 1) Lightweight Network (899.06M parameters totally), 2) Parameter-Efficient Training (49.57M parameters trainable) and 3) Simplified Inference (< 8G VRAM for 1024X768 resolution).
Other
717 stars 84 forks source link

Environment issues on Windows 11 #12

Open MarsEverythingTech opened 1 month ago

MarsEverythingTech commented 1 month ago

Hello,

I was trying to install the repo locally on my PC, however, I was unable to perform the last step: pip install git+https://github.com/facebookresearch/detectron2@main#subdirectory=projects/DensePose as it is giving me an error in red: error: could not build wheels for detectron2, which is required to install pyproject.toml-based projects I've been told to install VS Build Tools but that didn't help.

Thanks in advance

Zheng-Chong commented 1 month ago

If your PC is Windows OS, have you checked https://github.com/Zheng-Chong/CatVTON/issues/8

MarsEverythingTech commented 1 month ago

If your PC is Windows OS, have you checked #8 ?

Yes, I am on Windows 11, I also checked #8, but I am getting this error: LoadAutoMasker CatVTON AutoMasker LoadCatVTONPipeline Nodes that have failed to load will show as red on the graph.

Zheng-Chong commented 1 month ago

What about https://github.com/Zheng-Chong/CatVTON/issues/7 , it seems you have similar situation?

MarsEverythingTech commented 1 month ago

What about #7 , it seems you have similar situation?

This is what I did:

1- Installed the repo from URL using Manager 2- Downloaded the Detectron2 & DensePose from Releases and extracted them in to ComfyUI\venv\Lib\site-packages 3- Downloaded the .json (workflow) then dragged it into ComfyUI. 4- After that, the error showed up.

Also, the post you mentioned #7, I already installed Visual Studio Build Tools, but that still didn't help.

Zheng-Chong commented 1 month ago

2.Download ComfyUI-CatVTON.zip and unzip it in the custom_nodes folder under your ComfyUI project (clone from ComfyUI).

MarsEverythingTech commented 1 month ago

2.Download ComfyUI-CatVTON.zip and unzip it in the custom_nodes folder under your ComfyUI project (clone from ComfyUI).

Yes, I have already done that, but it didn't work

Zheng-Chong commented 1 month ago

2.Download ComfyUI-CatVTON.zip and unzip it in the custom_nodes folder under your ComfyUI project (clone from ComfyUI).

Yes, I have already done that, but it didn't work

After that. have you restarted the ComfyUI?

MarsEverythingTech commented 1 month ago

2.Download ComfyUI-CatVTON.zip and unzip it in the custom_nodes folder under your ComfyUI project (clone from ComfyUI).

Yes, I have already done that, but it didn't work

After that. have you restarted the ComfyUI?

Yes I did.

Zheng-Chong commented 1 month ago

I'm very sorry that we can't solve your problem, but we don't have a test machine running on WindowsOS and can't reproduce your problem, so we can't provide further help. I saw that you also raised the same problem in another repo Comfyui-catvton expecially for WindowOS, maybe it can be solved there.

MarsEverythingTech commented 1 month ago

I'm very sorry that we can't solve your problem, but we don't have a test machine running on WindowsOS and can't reproduce your problem, so we can't provide further help. I saw that you also raised the same problem in another repo Comfyui-catvton expecially for WindowOS, maybe it can be solved there.

How about installing it locally, I am just having trouble with the last step and is giving me this error:

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for detectron2 Running setup.py clean for detectron2 Successfully built detectron2-densepose Failed to build detectron2 ERROR: Could not build wheels for detectron2, which is required to install pyproject.toml-based projects

Zheng-Chong commented 1 month ago

I'm very sorry that we can't solve your problem, but we don't have a test machine running on WindowsOS and can't reproduce your problem, so we can't provide further help. I saw that you also raised the same problem in another repo Comfyui-catvton expecially for WindowOS, maybe it can be solved there.

How about installing it locally, I am just having trouble with the last step and is giving me this error:

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for detectron2 Running setup.py clean for detectron2 Successfully built detectron2-densepose Failed to build detectron2 ERROR: Could not build wheels for detectron2, which is required to install pyproject.toml-based projects

Another issue in detectron2 repo provides a solution, maybe you can try it. https://github.com/facebookresearch/detectron2/issues/5008#issuecomment-1787796388

MarsEverythingTech commented 1 month ago

I'm very sorry that we can't solve your problem, but we don't have a test machine running on WindowsOS and can't reproduce your problem, so we can't provide further help. I saw that you also raised the same problem in another repo Comfyui-catvton expecially for WindowOS, maybe it can be solved there.

How about installing it locally, I am just having trouble with the last step and is giving me this error: note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for detectron2 Running setup.py clean for detectron2 Successfully built detectron2-densepose Failed to build detectron2 ERROR: Could not build wheels for detectron2, which is required to install pyproject.toml-based projects

Another issue in detectron2 repo provides a solution, maybe you can try it. facebookresearch/detectron2#5008 (comment)

Would using a Docker help?

Zheng-Chong commented 1 month ago

is pip install git+https://github.com/facebookresearch/detectron2.git@v0.6#subdirectory=projects/DensePose the command you use?

https://github.com/Zheng-Chong/CatVTON/issues/5 reported the installment error of detectron2 in Win.

MarsEverythingTech commented 1 month ago

is pip install git+https://github.com/facebookresearch/detectron2.git@v0.6#subdirectory=projects/DensePose the command you use?

5 reported the installment error of detectron2 in Win.

Yes, I followed the step and got them installed. However, when running: python app.py --output_dir="resource/demo/output" --mixed_precision="bf16" --allow_tf32

I get the following error: No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\' C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py:383: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') Traceback (most recent call last): File "C:\CatVTON\app.py", line 12, in from model.cloth_masker import AutoMasker, vis_mask File "C:\CatVTON\model\cloth_masker.py", line 9, in from model.SCHP import SCHP # type: ignore File "C:\CatVTON\model\SCHP__init.py", line 1, in from model.SCHP import networks File "C:\CatVTON\model\SCHP\networks\init.py", line 3, in from model.SCHP.networks.AugmentCE2P import resnet101 File "C:\CatVTON\model\SCHP\networks\AugmentCE2P.py", line 21, in from model.SCHP.modules import InPlaceABNSync File "C:\CatVTON\model\SCHP\modules\init__.py", line 1, in from .bn import ABN, InPlaceABN, InPlaceABNSync File "C:\CatVTON\model\SCHP\modules\bn.py", line 10, in from .functions import * File "C:\CatVTON\model\SCHP\modules\functions.py", line 10, in _backend = load(name="inplace_abn", File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 1308, in load return _jit_compile( File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 1710, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 1810, in _write_ninja_file_and_build_library _write_ninja_file_to_build_library( File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 2199, in _write_ninja_file_to_build_library cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags() File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 1980, in _get_cuda_arch_flags arch_list[-1] += '+PTX' IndexError: list index out of range

Zheng-Chong commented 1 month ago

It looks like your torch and cuda versions conflict, maybe you can google the specific error message

MarsEverythingTech commented 1 month ago

It looks like your torch and cuda versions conflict, maybe you can google the specific error message

Could you please help me fix it?

MarsEverythingTech commented 1 month ago

It looks like your torch and cuda versions conflict, maybe you can google the specific error message

Ok now I am getting this error:

C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py:380: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST']. warnings.warn( INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "C:\CatVTON\app.py", line 12, in from model.cloth_masker import AutoMasker, vis_mask File "C:\CatVTON\model\cloth_masker.py", line 9, in from model.SCHP import SCHP # type: ignore File "C:\CatVTON\model\SCHP__init.py", line 1, in from model.SCHP import networks File "C:\CatVTON\model\SCHP\networks\init.py", line 3, in from model.SCHP.networks.AugmentCE2P import resnet101 File "C:\CatVTON\model\SCHP\networks\AugmentCE2P.py", line 21, in from model.SCHP.modules import InPlaceABNSync File "C:\CatVTON\model\SCHP\modules\init__.py", line 1, in from .bn import ABN, InPlaceABN, InPlaceABNSync File "C:\CatVTON\model\SCHP\modules\bn.py", line 10, in from .functions import File "C:\CatVTON\model\SCHP\modules\functions.py", line 10, in _backend = load(name="inplace_abn", File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 1312, in load return _jit_compile( File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 1722, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 1821, in _write_ninja_file_and_build_library _write_ninja_file_to_build_library( File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 2246, in _write_ninja_file_to_build_library _write_ninja_file( File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 2382, in _write_ninja_file cl_paths = subprocess.check_output(['where', File "C:\Users\miniconda3\envs\catvton\lib\subprocess.py", line 424, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\miniconda3\envs\catvton\lib\subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

Zheng-Chong commented 1 month ago

I'm sorry, but the environment setup is quite complex. It involves not only the operating system but also graphics card drivers and dependencies of other packages. I find it difficult to provide specific help to fix the bug for you.

I will keep this issue open to see if anyone else encounters a similar problem.

MarsEverythingTech commented 1 month ago

I'm sorry, but the environment setup is quite complex. It involves not only the operating system but also graphics card drivers and dependencies of other packages. I find it difficult to provide specific help to fix the bug for you.

I will keep this issue open to see if anyone else encounters a similar problem.

Hello, I have fixed that error by installing other packages for VS Build Tools, however, I am having this issue: \miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].

Then I did: set TORCH_CUDA_ARCH_LIST="8.6" but returned with another error: File "C:\Users\miniconda3\envs\catvton\lib\site-packages\torch\utils\cpp_extension.py", line 1998, in _get_cuda_arch_flags raise ValueError(f"Unknown CUDA arch ({arch}) or GPU not supported") ValueError: Unknown CUDA arch ("8.6") or GPU not supported

justinjohn0306 commented 1 month ago

I was able to get it working on windows but had to do a few adjustments in order to successfully build the modules

image
MarsEverythingTech commented 1 month ago

I was able to get it working on windows but had to do a few adjustments in order to successfully build the modules

image

Amazing! Could you please provide me the steps on how you made it work?

Thanks in advance

valaxy commented 5 days ago

failed on win11 but with error:

Ninja is required to load C++ extensions

but in fact

pip install ninja

works

dseditor commented 5 days ago

For the "where cl" error, Starting ComfyUI using “x64 Native Tools Command Prompt for VS 2022”,Do not using original cmd/powershell. That's maybe the problem of the VC env settings in WindowsOS.