Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development environment fails to start due to basicsr #70

Closed
dnoliver opened this issue Oct 1, 2024 · 3 comments
Closed

Development environment fails to start due to basicsr #70

dnoliver opened this issue Oct 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@dnoliver
Copy link
Contributor

dnoliver commented Oct 1, 2024

Describe the bug

After setting up the development environment for Meteor Lake, trying to run npm run dev fails.
The error is caused by basicsr, which is using a deprecated import for functional tensor at basicsr/data/degradations.py.:

# Current:
from torchvision.transforms.functional_tensor import rgb_to_grayscale

# Replace:
from torchvision.transforms.functional import rgb_to_grayscale

A workaround is to edit basicsr so it uses the right import statement. The following links provides context for such change:

pytorch/vision#7269
TencentARC/GFPGAN#539
XPixelGroup/BasicSR#699

After you change it, the development environment starts fine.

To Reproduce

Steps to reproduce the behavior:

  1. Start the development environment
  2. Run npm run dev

Expected behavior

Development environment should start

Screenshots

The error log is the following:

[electron-backend]: load url:http://localhost:25413/
[electron-backend]: #1 try to start python API
[17052:1001/145301.880:ERROR:CONSOLE(1)] "Request Autofill.enable failed. {"code":-32601,"message":"'Autofill.enable' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
[17052:1001/145301.880:ERROR:CONSOLE(1)] "Request Autofill.setAddresses failed. {"code":-32601,"message":"'Autofill.setAddresses' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
[ai-backend]: C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\transformers\deepspeed.py:23: FutureWarning: transformers.deepspeed module is deprecated and will be removed in a future version. Please import deepspeed modules directly from transformers.integrations
  warnings.warn(

[ai-backend]: C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: 'Could not find module 'C:\Users\Nicolas Oliver\.conda\envs\aipg_xpu\Lib\site-packages\torchvision\image.pyd' (or one of its dependencies). Try using the full path with constructor syntax.'If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
  warn(

[ai-backend]: 2024-10-01 14:53:06,706 - INFO - intel_extension_for_pytorch auto imported

[ai-backend]: Traceback (most recent call last):
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\service\web_api.py", line 6, in <module>
    from sd_adapter import SD_SSE_Adapter
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\ipex_llm\utils\ipex_importer.py", line 76, in custom_ipex_import

[ai-backend]:     return RAW_IMPORT(name, globals, locals, fromlist, level)
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\service\sd_adapter.py", line 7, in <module>
    import paint_biz
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\ipex_llm\utils\ipex_importer.py", line 80, in custom_ipex_import
    return RAW_IMPORT(name, globals, locals, fromlist, level)
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\service\paint_biz.py", line 28, in <module>
    from realesrgan import RealESRGANer
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\ipex_llm\utils\ipex_importer.py", line 76, in custom_ipex_import
    return RAW_IMPORT(name, globals, locals, fromlist, level)
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\service\realesrgan.py", line 11, in <module>
    from basicsr.archs.rrdbnet_arch import RRDBNet
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\ipex_llm\utils\ipex_importer.py", line 76, in custom_ipex_import
    return RAW_IMPORT(name, globals, locals, fromlist, level)
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\basicsr\__init__.py", line 4, in <module>
    from .data import *
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\ipex_llm\utils\ipex_importer.py", line 76, in custom_ipex_import
    return RAW_IMPORT(name, globals, locals, fromlist, level)
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\basicsr\data\__init__.py", line 22, in <module>
    _dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\basicsr\data\__init__.py", line 22, in <listcomp>

[ai-backend]:     _dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name in dataset_filenames]
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\importlib\__init__.py", line 126, in import_module

[ai-backend]:     return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\basicsr\data\realesrgan_dataset.py", line 11, in <module>

[ai-backend]:     from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\ipex_llm\utils\ipex_importer.py", line 76, in custom_ipex_import
    return RAW_IMPORT(name, globals, locals, fromlist, level)
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\basicsr\data\degradations.py", line 8, in <module>
    from torchvision.transforms.functional_tensor import rgb_to_grayscale
  File "C:\Users\Nicolas Oliver\Downloads\AI-Playground\env\lib\site-packages\ipex_llm\utils\ipex_importer.py", line 76, in custom_ipex_import
    return RAW_IMPORT(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'

[electron-backend]: Error: Process exited with code 1

Environment (please complete the following information):

  • OS: Windows11
  • GPU: [e.g. Intel Arc A770 16G]
  • CPU: Intel Core Ultra 7 155H
  • Version: tip of the main branch, commit d23a807

Additional context

This is the continuation for #69.

@dnoliver dnoliver added the bug Something isn't working label Oct 1, 2024
@Nuullll
Copy link
Contributor

Nuullll commented Oct 8, 2024

I believe this is a compatibility issue caused by IPEX 2.3 + IPEX-LLM 2.1 combination, please try with the latest dev branch.

@dnoliver
Copy link
Contributor Author

dnoliver commented Oct 8, 2024

Yes, tip of dev branch 72bed13 works fine.
Thank you!

@Nuullll
Copy link
Contributor

Nuullll commented Oct 9, 2024

Fixed by #68

@Nuullll Nuullll closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants