notAI-tech / NudeNet

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

ModuleNotFoundError: No module named 'nudenet' #52

Closed UnifySoftTech closed 3 years ago

UnifySoftTech commented 4 years ago

(tf) C:\nude>nude.py Traceback (most recent call last): File "C:\nude\nude.py", line 2, in from nudenet import NudeClassifier ModuleNotFoundError: No module named 'nudenet

I am getting this error while trying to use a classifier

bedapudi6788 commented 4 years ago

Is the module installed correctly? Can you run pip show nudenet and post the output.

UnifySoftTech commented 4 years ago

Thanks for the quick response, i reinstalled everything and that issue seems to have solved but now when I run the classifier i am getting another error

Using TensorFlow backend. 2020-10-05 20:09:46.298392: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found 2020-10-05 20:09:46.298539: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. Downloading the checkpoint to C:\Users\Unify-SoftTech.NudeNet/classifier MB100% (160.0 of 160.0) |#############################################################################################################################################################################| Elapsed Time: 0:01:03 Time: 0:01:03 Succefully Downloaded to: C:\Users\Unify-SoftTech.NudeNet/classifier Traceback (most recent call last): File "C:\nude\nude.py", line 5, in classifier = NudeClassifier() File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\nudenet\classifier.py", line 36, in init self.nsfw_model = keras.models.load_model(model_path) File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\engine\saving.py", line 419, in load_model model = _deserialize_model(f, custom_objects, compile) File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\engine\saving.py", line 225, in _deserialize_model model = model_from_config(model_config, custom_objects=custom_objects) File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\engine\saving.py", line 458, in model_from_config return deserialize(config, custom_objects=custom_objects) File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\layers__init.py", line 52, in deserialize return deserialize_keras_object(config, File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\utils\generic_utils.py", line 142, in deserialize_keras_object return cls.from_config( File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\engine\network.py", line 1022, in from_config process_layer(layer_data) File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\engine\network.py", line 1007, in process_layer layer = deserialize_layer(layer_data, File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\layers__init__.py", line 52, in deserialize return deserialize_keras_object(config, File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\utils\generic_utils.py", line 147, in deserialize_keras_object return cls.from_config(config['config']) File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\engine\base_layer.py", line 1109, in from_config return cls(*config) File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\legacy\interfaces.py", line 91, in wrapper return func(args, **kwargs) File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\engine\input_layer.py", line 84, in init__ input_tensor = K.placeholder(shape=batch_input_shape, File "C:\Users\Unify-SoftTech\AppData\Roaming\Python\Python38\site-packages\keras\backend\tensorflow_backend.py", line 517, in placeholder x = tf.placeholder(dtype, shape=shape, name=name) AttributeError: module 'tensorflow' has no attribute 'placeholder'

bedapudi6788 commented 4 years ago

Might be because of tensorflow version. The versions I have tested the library with are tf 1.14, keras 2.2.4. You can also use the docker images if you don't want to install the libraries manually.

UnifySoftTech commented 4 years ago

Thanks for the response, i tried to look for TensorFlow 1.14 but could not locate it, I am not familiar with Docker so I am out of options I guess.

Thank You

On Tue, Oct 6, 2020 at 3:03 PM Bedapudi Praneeth notifications@github.com wrote:

Might be because of tensorflow version. The versions I have tested the library with are tf 1.14, keras 2.2.4. You can also use the docker images if you don't want to install the libraries manually.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/notAI-tech/NudeNet/issues/52#issuecomment-704150302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AII2OAR2BNNEBCDOBHJIFWTSJLP6JANCNFSM4SEQK7PA .

-- Ravi Manra CEO & FOUNDER [image: Logo] https://www.unifysofttech.com/

Unify SoftTech 37/204 Sunrise Apartments,Green Model Town,Jalandhar 144003,Punjab,India m: +91 7814447775 e: ravi@unifysofttech.com

Book Appointment https://calendly.com/unifysofttech/discussion-call

www.unifysofttech.com [image: Facebook icon] https://www.facebook.com/unifysofttech [image: LinkedIn icon] https://www.linkedin.com/in/ravi-manra/ [image: Twitter icon] https://twitter.com/ravimanra [image: Instagram icon] https://www.instagram.com/ravimanra/

The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.

bedapudi6788 commented 4 years ago

setting up docker is pretty easy. you just need to install it from it's official website and run docker run -it -p8080:8080 notaitech/nudenet:detector

bedapudi6788 commented 4 years ago

or, you might want to create a python 3.6 virtual environment using miniconda (https://docs.conda.io/projects/conda/en/latest/user-guide/install/). tf 1.14 will be available there.

UnifySoftTech commented 4 years ago

Thank you so much for the response, I will look into this and let you know if any issues arise.

On Tue, Oct 6, 2020 at 3:35 PM Bedapudi Praneeth notifications@github.com wrote:

or, you might want to create a python 3.6 virtual environment using miniconda ( https://docs.conda.io/projects/conda/en/latest/user-guide/install/). tf 1.14 will be available there.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/notAI-tech/NudeNet/issues/52#issuecomment-704167143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AII2OAVSIM2YKXXIRAXJUQTSJLTWTANCNFSM4SEQK7PA .

-- Ravi Manra CEO & FOUNDER [image: Logo] https://www.unifysofttech.com/

Unify SoftTech 37/204 Sunrise Apartments,Green Model Town,Jalandhar 144003,Punjab,India m: +91 7814447775 e: ravi@unifysofttech.com

Book Appointment https://calendly.com/unifysofttech/discussion-call

www.unifysofttech.com [image: Facebook icon] https://www.facebook.com/unifysofttech [image: LinkedIn icon] https://www.linkedin.com/in/ravi-manra/ [image: Twitter icon] https://twitter.com/ravimanra [image: Instagram icon] https://www.instagram.com/ravimanra/

The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.

bedapudi6788 commented 4 years ago

@UnifySoftTech with the latest version of the repo, tensorflow versions upto 1.15.4 are supported. keras and keras-retinanet are no longer required.

UnifySoftTech commented 4 years ago

Great, thanks i will try them now. Just so you know i want to impliment this into a video uploading application where we plan to extract frames from the video and then check those images against this repo, not sure if this will work or not, will update you.

On Sat, Oct 10, 2020 at 11:49 PM Bedapudi Praneeth notifications@github.com wrote:

@UnifySoftTech https://github.com/UnifySoftTech with the latest version of the repo, tensorflow versions upto 1.15.4 are supported. keras and keras-retinanet are no longer required.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/notAI-tech/NudeNet/issues/52#issuecomment-706590761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AII2OAWPYFODU7UQQGX4RO3SKCQUTANCNFSM4SEQK7PA .

-- Ravi Manra CEO & FOUNDER [image: Logo] https://www.unifysofttech.com/

Unify SoftTech 37/204 Sunrise Apartments,Green Model Town,Jalandhar 144003,Punjab,India m: +91 7814447775 e: ravi@unifysofttech.com

Book Appointment https://calendly.com/unifysofttech/discussion-call

www.unifysofttech.com [image: Facebook icon] https://www.facebook.com/unifysofttech [image: LinkedIn icon] https://www.linkedin.com/in/ravi-manra/ [image: Twitter icon] https://twitter.com/ravimanra [image: Instagram icon] https://www.instagram.com/ravimanra/

The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.

bedapudi6788 commented 4 years ago

The repo has inbuilt video support with configurable frame selection. That might help.

UnifySoftTech commented 4 years ago

thats awesome, if i would need to support for installation would you be able to help me with that?

On Sat, Oct 10, 2020 at 11:56 PM Bedapudi Praneeth notifications@github.com wrote:

The repo has inbuilt video support with configurable frame selection. That might help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/notAI-tech/NudeNet/issues/52#issuecomment-706591604, or unsubscribe https://github.com/notifications/unsubscribe-auth/AII2OAUTO2A7DBWH5WAT7Z3SKCRO5ANCNFSM4SEQK7PA .

-- Ravi Manra CEO & FOUNDER [image: Logo] https://www.unifysofttech.com/

Unify SoftTech 37/204 Sunrise Apartments,Green Model Town,Jalandhar 144003,Punjab,India m: +91 7814447775 e: ravi@unifysofttech.com

Book Appointment https://calendly.com/unifysofttech/discussion-call

www.unifysofttech.com [image: Facebook icon] https://www.facebook.com/unifysofttech [image: LinkedIn icon] https://www.linkedin.com/in/ravi-manra/ [image: Twitter icon] https://twitter.com/ravimanra [image: Instagram icon] https://www.instagram.com/ravimanra/

The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.

bedapudi6788 commented 4 years ago

Sure. With the latest version, as long as you are able to install tensorflow <= 1.15.4, it should work.

Take a look at the sections named Classifier Usage: and Detector Usage: in the readme for prediction on video.

UnifySoftTech commented 4 years ago

sure, i will try this tomorrow and will let you know if I face trouble.

On Sun, Oct 11, 2020 at 12:20 AM Bedapudi Praneeth notifications@github.com wrote:

Sure. With the latest version, as long as you are able to install tensorflow <= 1.15.4, it should work.

Take a look at the sections named Classifier Usage: and Detector Usage: in the readme for prediction on video.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/notAI-tech/NudeNet/issues/52#issuecomment-706594939, or unsubscribe https://github.com/notifications/unsubscribe-auth/AII2OAVDPLX3OVPKG5E2SLLSKCUGLANCNFSM4SEQK7PA .

-- Ravi Manra CEO & FOUNDER [image: Logo] https://www.unifysofttech.com/

Unify SoftTech 37/204 Sunrise Apartments,Green Model Town,Jalandhar 144003,Punjab,India m: +91 7814447775 e: ravi@unifysofttech.com

Book Appointment https://calendly.com/unifysofttech/discussion-call

www.unifysofttech.com [image: Facebook icon] https://www.facebook.com/unifysofttech [image: LinkedIn icon] https://www.linkedin.com/in/ravi-manra/ [image: Twitter icon] https://twitter.com/ravimanra [image: Instagram icon] https://www.instagram.com/ravimanra/

The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.

bedapudi6788 commented 3 years ago

@UnifySoftTech from the current release, nudenet doesn't require any version of tensorflow and will work as expected on all newer python versions.

UnifySoftTech commented 3 years ago

Thank you for the update we ended up using the 3rd Party API , but i will give this one more try as it can save us money :)