Open cirosantilli opened 7 months ago
same issue here
Did you find any solution?
Edit : works with python 3.6 and tensorflow==2.2.0
Edit : works with python 3.6 and tensorflow==2.2.0
Ah nice! Maintainers made the fatal mistake of using >=
on requirements.txt
: https://github.com/GantMan/nsfw_model/blob/699b6796a55604341fbfdffe2b27ced1d868c591/requirements.txt#L1
That's annoying, on Python 3.11.6 I get:
$ pip install tensorflow==2.2.0
ERROR: Could not find a version that satisfies the requirement tensorflow==2.2.0 (from versions: 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.12.1, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1, 2.14.0rc0, 2.14.0rc1, 2.14.0, 2.14.1, 2.15.0rc0, 2.15.0rc1, 2.15.0, 2.15.0.post1, 2.15.1, 2.16.0rc0, 2.16.1)
ERROR: No matching distribution found for tensorflow==2.2.0
so you really have to go down the Python version... and pyenv install 3.6.0
segfaults...
my solution
pip install tf-keras==2.16.0 tensorflow-hub==0.16.0
Tensorflow has some change about keras. (keras 2 -> keras3)
There is migration issue.
Working with venv in Python 3.10.0 and pip install tf-keras==2.16.0 tensorflow-hub==0.16.0. Here’s the pip freeze output from the virtual environment:
absl-py==2.1.0 asttokens==2.4.1 astunparse==1.6.3 certifi==2024.8.30 charset-normalizer==3.4.0 colorama==0.4.6 comm==0.2.2 debugpy==1.8.7 decorator==5.1.1 exceptiongroup==1.2.2 executing==2.1.0 flatbuffers==24.3.25 gast==0.6.0 google-pasta==0.2.0 grpcio==1.67.1 h5py==3.12.1 idna==3.10 ipykernel==6.29.5 ipython==8.29.0 jedi==0.19.1 jupyter_client==8.6.3 jupyter_core==5.7.2 keras==3.6.0 libclang==18.1.1 Markdown==3.7 markdown-it-py==3.0.0 MarkupSafe==3.0.2 matplotlib-inline==0.1.7 mdurl==0.1.2 ml-dtypes==0.4.1 namex==0.0.8 nest-asyncio==1.6.0 numpy==2.0.2 opt_einsum==3.4.0 optree==0.13.0 packaging==24.1 parso==0.8.4 pillow==11.0.0 platformdirs==4.3.6 prompt_toolkit==3.0.48 protobuf==5.28.3 psutil==6.1.0 pure_eval==0.2.3 Pygments==2.18.0 python-dateutil==2.9.0.post0 pywin32==308 pyzmq==26.2.0 requests==2.32.3 rich==13.9.4 six==1.16.0 stack-data==0.6.3 tensorboard==2.18.0 tensorboard-data-server==0.7.2 tensorflow==2.18.0 tensorflow-hub==0.12.0 tensorflow-io-gcs-filesystem==0.31.0 tensorflow_intel==2.18.0 termcolor==2.5.0 tornado==6.4.1 traitlets==5.14.3 typing_extensions==4.12.2 urllib3==2.2.3 wcwidth==0.2.13 Werkzeug==3.1.2 wrapt==1.16.0
Clone repo at 699b6796a55604341fbfdffe2b27ced1d868c591 then try to run on a clean virtualenv:
tmp.py
blows up with:
Ubuntu 23.10, Python 3.11.6.
pip freeze
contains: