notAI-tech / NudeNet

Lightweight nudity detection
https://nudenet.notai.tech/
GNU Affero General Public License v3.0
1.76k stars 342 forks source link

How to use tensorflow version with GPU support ? #86

Closed bdfy closed 3 years ago

bdfy commented 3 years ago

Ubuntu 20.04, tensorflow==2.4.1, nudenet=2.0.6

python3.8 ./NudeNet-2.0.6/fastDeploy_recipes/detector/predictor.py Traceback (most recent call last): File "./predictor.py", line 5, in <module> detector = NudeDetector(os.getenv('MODEL_NAME', 'default')) File "~/.local/lib/python3.8/site-packages/nudenet/detector.py", line 62, in __init__ self.detection_model = tf.contrib.predictor.from_saved_model( AttributeError: module 'tensorflow' has no attribute 'contrib' tensorflow 1.x not supported by by modern linux distros, modern cuda drivers not supported ancients distros :(

TomasKopecky commented 3 years ago

Even though I am running Nudenet in a docker container, the standard Linux approach could be similar.

My specs:

Ubuntu-18.04 CUDA 10.0 cuDNN 7.6 Python 3.6

Installed via pip:

Nudenet 2.0.6 Tensorflow-gpu 1.14.0

It would definitely run on a different spec system but you can try my approach.

bdfy commented 3 years ago

Even though I am running Nudenet in a docker container, the standard Linux approach could be similar.

My specs:

Ubuntu-18.04 CUDA 10.0 cuDNN 7.6 Python 3.6

Installed via pip:

Nudenet 2.0.6 Tensorflow-gpu 1.14.0

It would definitely run on a different spec system but you can try my approach.

nvidia support 1.15 tensorflow on modern GPU:

https://github.com/nvidia/tensorflow/