picobyte / stable-diffusion-webui-wd14-tagger

Labeling extension for Automatic1111's Web UI
580 stars 70 forks source link

bug ModuleNotFoundError: No module named 'tensorflow' #2

Closed wzgrx closed 1 year ago

wzgrx commented 1 year ago

sd-webui-prompt-all-in-one background API service started successfully. *** Error loading script: tagger.py Traceback (most recent call last): File "G:\stable-diffusion-webui\modules\scripts.py", line 295, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "G:\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\scripts\tagger.py", line 5, in from tagger.ui import on_ui_tabs File "G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\tagger\ui.py", line 12, in from tensorflow import version as tf_version ModuleNotFoundError: No module named 'tensorflow'

picobyte commented 1 year ago

Ah I see, requirements.txt and install.py were not there. I've added them to the master branch. If you update the repository (e.g. in the extensions tab after re-reading the repositories from the repo) does it now work?

I should also merge the dev branch, one sec.. Done. There are some error checks now. if you find they report incorrectly, try editing the respective field again, that resolved the issues for me.

wzgrx commented 1 year ago

Ah I see, requirements.txt and install.py were not there. I've added them to the master branch. If you update the repository (e.g. in the extensions tab after re-reading the repositories from the repo) does it now work?

I should also merge the dev branch, one sec.. Done. There are some error checks now. if you find they report incorrectly, try editing the respective field again, that resolved the issues for me.

Installing requirements

Error running install.py for extension G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger. Command: "G:\stable-diffusion-webui\venv\Scripts\Python.exe" "G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\install.py" Error code: 1 stdout: loading WD14-tagger reqs from G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt *** Checking WD14-tagger requirements.


stderr: Traceback (most recent call last): File "G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\install.py", line 11, in run(f'"{sys.executable}" -m pip install -r "{req_file}"', File "G:\stable-diffusion-webui\modules\launch_utils.py", line 107, in run raise RuntimeError("\n".join(error_bits)) RuntimeError: Couldn't install WD14-tagger requirements.. Command: "G:\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install -r "G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt" Error code: 1 stdout: Collecting deepdanbooru>=1.0.0 (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 1)) Using cached deepdanbooru-1.0.2-py3-none-any.whl (27 kB) Collecting fastapi>=0.100.0 (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 2)) Using cached fastapi-0.100.0-py3-none-any.whl (65 kB) Collecting gradio>=3.36.1 (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 3)) Using cached gradio-3.36.1-py3-none-any.whl (19.8 MB) Requirement already satisfied: huggingface_hub>=0.15.1 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 4)) (0.15.1) Collecting launch>=0.1.3 (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 5)) Using cached launch-0.1.3.tar.gz (10 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting modules>=1.0.0 (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 6)) Using cached modules-1.0.0.tar.gz (525 bytes) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: numpy>=1.23.5 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 7)) (1.23.5) Requirement already satisfied: onnxruntime>=1.14.1 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 8)) (1.15.0) Requirement already satisfied: opencv_contrib_python>=4.7.0.72 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 9)) (4.7.0.72) Requirement already satisfied: opencv_python>=4.7.0.72 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 10)) (4.7.0.72) Requirement already satisfied: opencv_python_headless>=4.7.0.72 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 11)) (4.7.0.72) Requirement already satisfied: packaging>=23.1 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 12)) (23.1) Requirement already satisfied: pandas>=2.0.1 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 13)) (2.0.2) Collecting Pillow>=10.0.0 (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 14)) Using cached Pillow-10.0.0-cp310-cp310-win_amd64.whl (2.5 MB) Requirement already satisfied: pydantic>=1.10.7 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 15)) (1.10.8) Requirement already satisfied: tensorflow>=2.11.1 in g:\stable-diffusion-webui\venv\lib\site-packages (from -r G:\stable-diffusion-webui\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt (line 16)) (2.13.0)


stderr: ERROR: Ignored the following versions that require a different python version: 0.23.0 Requires-Python >=3.6, <3.10 ERROR: Could not find a version that satisfies the requirement tensorflow_io>=0.32.0 (from versions: 0.23.1, 0.24.0, 0.25.0, 0.26.0, 0.27.0, 0.28.0, 0.29.0, 0.30.0, 0.31.0) *** ERROR: No matching distribution found for tensorflow_io>=0.32.0

picobyte commented 1 year ago

It seems like you have different versions of python packages and they conflict. I removed version numbers, does it now work?

picobyte commented 1 year ago

hmm tensorflow has only one release, 0.32.0, and that requires Python >=3.6 apparently. You can remove that one from requirements.txt, It is only required if you run the huge batch query. If you need that, apparently you require a newer python version. This is no different in the scripted version.

wzgrx commented 1 year ago

hmm tensorflow has only one release, 0.32.0, and that requires Python >=3.6 apparently. You can remove that one from requirements.txt, It is only required if you run the huge batch query. If you need that, apparently you require a newer python version. This is no different in the scripted version.

The pip install tensorflow==2.13.0 command seems to be valid

picobyte commented 1 year ago

requirements.txt (based on my config, after running pipreqs --force $CWD) had tensorflow>=2.11.1 Maybe that was not the best option, because the huge batch requires 2.10, but anyway the requirements.txt are now without version number.

wzgrx commented 1 year ago

requirements.txt (based on my config, after running ) had Maybe that was not the best option, because the huge batch requires 2.10, but anyway the requirements.txt are now without version number.pipreqs --force $CWD``tensorflow>=2.11.1

Okay, understand

picobyte commented 1 year ago

thanks for reporting, the addition of requirements.txt is bound to give less issues.

wzgrx commented 1 year ago

thanks for reporting, the addition of requirements.txt is bound to give less issues.

Thank you to the developers for their hard maintenance