mirror of
https://github.com/SillyTavern/SillyTavern-Extras.git
synced 2026-10-16 02:21:52 +00:00
[GH-ISSUE #78] Error No module named 'keras.engine' when starting the server with classify #52
Labels
No labels
bug
duplicate
planned
pull-request
under consideration
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
SillyTavern/SillyTavern-Extras#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nightboysfm on GitHub (Jul 9, 2023).
Original GitHub issue: https://github.com/SillyTavern/SillyTavern-Extras/issues/78
I started the server with classify module and it gave me the error "No module named 'keras.engine'" when the server is trying to load the bert model.
To cut it short after some investigation the issue is that I had keras 2.13.1 and tensorflow 2.13.0, seem not compatible but I didn't research much on this point.
I saw this with :
G:\AI\SillyTavern-extras>pip install keras
Requirement already satisfied: keras in .......\python310\site-packages (2.13.1)
G:\AI\SillyTavern-extras>pip install tensorflow
Requirement already satisfied: tensorflow in .......\python310\site-packages (2.13.0)
I searched for a keras 2.13.0 package but it doesn't seem to exist, seem the cause of the issue ? So search for a version that exist for both package.
To fix the issue I did :
pip uninstall keras
pip uninstall tensorflow
pip install tensorflow==2.12.0
pip install keras==2.12.0
You can close this, but if anyone else have this issue you have some information.
Maybe also you can specify working version in requirements.txt ? Not sure what is possible to do on your side.
@Cohee1207 commented on GitHub (Jul 9, 2023):
Did you install without conda into the system python environment?
@MoeMonsuta commented on GitHub (Jul 13, 2023):
I think I produced this exact problem when I installed Dreambooth requirements and it installed Tensorflow when I already had Tensorflow-Intel installed. Doing
pip uninstall tensorflowsolved the "No module named 'keras.engine'" issue for me. I have an Intel CPU so I kept the Tensorflow-Intel library installed.pip list(List installed packages.) andpip check(Verify installed packages have compatible dependencies) helped me look into version discrepancies.@Cohee1207 commented on GitHub (Jul 13, 2023):
Install into a conda environment or venv please. System install is not something easy to support because it creates incompatibility.
@nightboysfm commented on GitHub (Jul 18, 2023):
Sorry for the late reply, I did vanilla install, something like this:
git clone https://github.com/SillyTavern/SillyTavern-extras
cd SillyTavern-extras
python -m pip install -r requirements-complete.txt
I did nothing like installing in a specific environment, I'm a noob when it come to python so I just followed instructions, I think it's system wide.
Not sure it's worth to mention but I installed stable diffusion webui a few weeks ago, maybe the conflict come from there. I think it use also conda and I did want to prevent conflits, reason of the vanilla install.
Maybe more specific instructions about installing ST-extras into a venv could prevent this issue.
Or maybe I should have just installed with conda, I don't know if it handles well parallel installations with stable diffusion.
@Cohee1207 commented on GitHub (Jul 18, 2023):
The documentation in readme explicitly says that conda is recommended and provides line by line instructions
The purpose of it is to handle parallel installation so there should not be any issues
@nightboysfm commented on GitHub (Jul 27, 2023):
I mean it would be an improvement to modify the vanilla instructions to use a venv, it doesn't seem complicated, but I don't know if it have other sides effects.
We all know that in IT "should not" mean "will happen at some point", so that was just and idea to prevent issues when using vanilla install.
For me the issue is solved, so I close this. Thanks for the explanations.