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

Error loading script in SD Webui 5ab7f213 #16

Closed
boomerchan opened this issue May 9, 2023 · 5 comments
Closed

Error loading script in SD Webui 5ab7f213 #16

boomerchan opened this issue May 9, 2023 · 5 comments

Comments

@boomerchan
Copy link

Running the most recent version of SD Webui. pip install image-reward ran successfully. Dropped image_reward.py into C:\Users\user\stable-diffusion-webui\scripts. SD Webui is printing the following error:

Error loading script: image_reward.py
Traceback (most recent call last):
  File "C:\Users\user\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "C:\Users\user\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\user\stable-diffusion-webui\scripts\image_reward.py", line 18, in <module>
    import ImageReward as reward
ModuleNotFoundError: No module named 'ImageReward'

commandline args: --xformers --autolaunch --deepdanbooru
python: 3.10.6
commit: 5ab7f213

@tongyx361
Copy link
Collaborator

Thank you so much for the issue! Let's resolve it together 😀

ModuleNotFoundError: No module named 'ImageReward' indicates that the Python interpreter failed to search for the ImageReward package from your Python environment.

So you might need to try checking your Python environment, which might has the following problems:

  • The environment shown is different from the one actually used (this sometimes happens in Conda), try reactivating the environment with conda activate <env_name_with_image-reward_installed> in Conda for example.
  • pip did not install image-reward successfully, try pip show image-reward to check if it has been installed successfully.

If the problem is still not solved after checking the above problems and trying the corresponding solutions, please feel free to continue to ask.

@bparlan
Copy link

bparlan commented May 21, 2023

Since my error is similar and I can provide further information, I am commenting and populating similar error. pip install image-reward ran successfully:

C:\WINDOWS\system32>pip show image-reward
Name: image-reward
Version: 1.2
Summary: ImageReward
Home-page: https://github.com/THUDM/ImageReward
Author: Jiazheng Xu, et al.
Author-email: <xjz22@mails.tsinghua.edu.cn>
License: Apache 2.0 license
Location: c:\python310\lib\site-packages
Requires: fairscale, huggingface-hub, timm, transformers
Required-by:

Dropped image_reward.py into D:\Projects\StableRegina\stable-diffusion-webui\scripts.
SD Webui is printing the following error:

Launching Web UI with arguments: --autolaunch --medvram --xformers
Error loading script: image_reward.py
Traceback (most recent call last):
  File "D:\Projects\StableRegina\stable-diffusion-webui\modules\scripts.py", line 257, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "D:\Projects\StableRegina\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\Projects\StableRegina\stable-diffusion-webui\scripts\image_reward.py", line 18, in <module>
    import ImageReward as reward
ModuleNotFoundError: No module named 'ImageReward'

commandline args: --medvram --xformers
python: Python 3.10.6

@tongyx361
Copy link
Collaborator

Since my error is similar and I can provide further information, I am commenting and populating similar error. pip install image-reward ran successfully:

C:\WINDOWS\system32>pip show image-reward
Name: image-reward
Version: 1.2
Summary: ImageReward
Home-page: https://github.com/THUDM/ImageReward
Author: Jiazheng Xu, et al.
Author-email: <xjz22@mails.tsinghua.edu.cn>
License: Apache 2.0 license
Location: c:\python310\lib\site-packages
Requires: fairscale, huggingface-hub, timm, transformers
Required-by:

Dropped image_reward.py into D:\Projects\StableRegina\stable-diffusion-webui\scripts. SD Webui is printing the following error:

Launching Web UI with arguments: --autolaunch --medvram --xformers
Error loading script: image_reward.py
Traceback (most recent call last):
  File "D:\Projects\StableRegina\stable-diffusion-webui\modules\scripts.py", line 257, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "D:\Projects\StableRegina\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\Projects\StableRegina\stable-diffusion-webui\scripts\image_reward.py", line 18, in <module>
    import ImageReward as reward
ModuleNotFoundError: No module named 'ImageReward'

commandline args: --medvram --xformers python: Python 3.10.6

Thank you very much for offerring the error information!

It seems that you have encountered the same error as mentioned in this issue. You can refer to the suggested solution in it (activate venv and reinstall "image-reward").

Afterwards, that issue encountered some other errors that I couldn't reproduce. If you are able to reproduce similar errors, please let us know. Your feedback will greatly help us in improving this project!

@bparlan
Copy link

bparlan commented May 22, 2023

It seems that you have encountered the same error as mentioned in this issue. You can refer to the suggested solution in it (activate venv and reinstall "image-reward").

You were definitely right about it. Activate venv and reinstall image-reward solved my issue out. I will keep updating whenever I encounter any issue! Thanks for awesome community.

@tongyx361
Copy link
Collaborator

It seems that you have encountered the same error as mentioned in this issue. You can refer to the suggested solution in it (activate venv and reinstall "image-reward").

You were definitely right about it. Activate venv and reinstall image-reward solved my issue out. I will keep updating whenever I encounter any issue! Thanks for awesome community.

Thank you very much for offering us with information to help identify and resolve the issue.

I'm closing this issue for now. If any of you encounters any new problems, please feel free to open a new issue.

Let's work together to make the entire community better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants