open-mmlab / PowerPaint

[ECCV 2024] PowerPaint, a versatile image inpainting model that supports text-guided object inpainting, object removal, image outpainting and shape-guided object inpainting with only a single model. 一个高质量多功能的图像修补模型,可以同时支持插入物体、移除物体、图像扩展、形状可控的物体生成,只需要一个模型
https://powerpaint.github.io/
MIT License
658 stars 41 forks source link

Another MMCV issue #13

Closed alexgilseg closed 2 months ago

alexgilseg commented 10 months ago

So I get this error:

(powerpaint) D:\SDXL\PowerP\PowerPaint>python gradio_PowerPaint.py
Traceback (most recent call last):
  File "D:\SDXL\PowerP\PowerPaint\gradio_PowerPaint.py", line 15, in <module>
    from utils.utils import TokenizerWrapper, add_tokens
  File "D:\SDXL\PowerP\PowerPaint\utils\utils.py", line 12, in <module>
    from mmagic.utils import try_import
  File "C:\Users\alexg\anaconda3\envs\powerpaint\lib\site-packages\mmagic\__init__.py", line 35, in <module>
    assert (mmcv_min_version <= mmcv_version < mmcv_max_version), \
AssertionError: mmcv==2.1.0 is used but incompatible. Please install mmcv-full>=[2, 0, 0], <[2, 1, 0].

So it seems my mmcv is too "new"

When I try to downgrade it with: mim install mmcv==2.0.0

I get:

C:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\utils\cpp_extension.py:383: UserWarning: Error checking compiler version for cl: [WinError 2] Det går inte att hitta filen
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
      creating build\temp.win-amd64-3.9
      creating build\temp.win-amd64-3.9\Release
      creating build\temp.win-amd64-3.9\Release\mmcv
      creating build\temp.win-amd64-3.9\Release\mmcv\ops
      creating build\temp.win-amd64-3.9\Release\mmcv\ops\csrc
      creating build\temp.win-amd64-3.9\Release\mmcv\ops\csrc\pytorch
      creating build\temp.win-amd64-3.9\Release\mmcv\ops\csrc\pytorch\cpu
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\alexg\AppData\Local\Temp\pip-install-r_ffhlt8\mmcv_aac7a1dca1754fcd87bd8e8052efe08d\mmcv\ops\csrc\common -IC:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include -IC:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include\TH -IC:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include\THC -IC:\Users\alexg\anaconda3\envs\PowerPaint\include -IC:\Users\alexg\anaconda3\envs\PowerPaint\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" /EHsc /Tp./mmcv/ops/csrc/pytorch/cpu\active_rotated_filter.cpp /Fobuild\temp.win-amd64-3.9\Release\./mmcv/ops/csrc/pytorch/cpu\active_rotated_filter.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc /std:c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0
      active_rotated_filter.cpp
      C:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include\c10/util/C++17.h(27): fatal error C1189: #error:  You need C++17 to compile PyTorch
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mmcv
  Running setup.py clean for mmcv
Failed to build mmcv
ERROR: Could not build wheels for mmcv, which is required to install pyproject.toml-based projects
tranquan687 commented 7 months ago

So I get this error:

(powerpaint) D:\SDXL\PowerP\PowerPaint>python gradio_PowerPaint.py
Traceback (most recent call last):
  File "D:\SDXL\PowerP\PowerPaint\gradio_PowerPaint.py", line 15, in <module>
    from utils.utils import TokenizerWrapper, add_tokens
  File "D:\SDXL\PowerP\PowerPaint\utils\utils.py", line 12, in <module>
    from mmagic.utils import try_import
  File "C:\Users\alexg\anaconda3\envs\powerpaint\lib\site-packages\mmagic\__init__.py", line 35, in <module>
    assert (mmcv_min_version <= mmcv_version < mmcv_max_version), \
AssertionError: mmcv==2.1.0 is used but incompatible. Please install mmcv-full>=[2, 0, 0], <[2, 1, 0].

So it seems my mmcv is too "new"

When I try to downgrade it with: mim install mmcv==2.0.0

I get:

C:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\utils\cpp_extension.py:383: UserWarning: Error checking compiler version for cl: [WinError 2] Det går inte att hitta filen
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
      creating build\temp.win-amd64-3.9
      creating build\temp.win-amd64-3.9\Release
      creating build\temp.win-amd64-3.9\Release\mmcv
      creating build\temp.win-amd64-3.9\Release\mmcv\ops
      creating build\temp.win-amd64-3.9\Release\mmcv\ops\csrc
      creating build\temp.win-amd64-3.9\Release\mmcv\ops\csrc\pytorch
      creating build\temp.win-amd64-3.9\Release\mmcv\ops\csrc\pytorch\cpu
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\alexg\AppData\Local\Temp\pip-install-r_ffhlt8\mmcv_aac7a1dca1754fcd87bd8e8052efe08d\mmcv\ops\csrc\common -IC:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include -IC:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include\TH -IC:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include\THC -IC:\Users\alexg\anaconda3\envs\PowerPaint\include -IC:\Users\alexg\anaconda3\envs\PowerPaint\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" /EHsc /Tp./mmcv/ops/csrc/pytorch/cpu\active_rotated_filter.cpp /Fobuild\temp.win-amd64-3.9\Release\./mmcv/ops/csrc/pytorch/cpu\active_rotated_filter.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc /std:c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0
      active_rotated_filter.cpp
      C:\Users\alexg\anaconda3\envs\PowerPaint\lib\site-packages\torch\include\c10/util/C++17.h(27): fatal error C1189: #error:  You need C++17 to compile PyTorch
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

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

try this, it works for me https://github.com/zhuang2002/PowerPaint/issues/23#issue-2206231108

zengyh1900 commented 2 months ago

We have removed all the dependencies of mmcv, mmengine and mmagic. To train your own powerpaint models, you can check our dev branch.