sepinf-inc / IPED

IPED Digital Forensic Tool. It is an open source software that can be used to process and analyze digital evidence, often seized at crime scenes by law enforcement or in a corporate investigation by private examiners.
Other
924 stars 217 forks source link

The task NSFWNudityDetectTask.py freezes together with Wav2Vec2 #1892

Closed Lucio-hub closed 9 months ago

Lucio-hub commented 11 months ago

IPED becomes unresponsive after initialization of indexing if the task for the nudity detection option "enableYahooNSFWDetection = true" is enabled in IPEDConfig.txt, although it has installed without problems, the modules, keras, tensorflow and pillow with pip install command, according to the guidelines of the manual.

NSFWNudityDetectTask py Não inicializa

lfcnassif commented 11 months ago

What version of keras and tensorflow have you installed?

Lucio-hub commented 11 months ago

Boa tarde!

C:\IPED414\iped-4.1.4>cd python

C:\IPED414\iped-4.1.4\python>pip install keras Requirement already satisfied: keras in c:\iped414\iped-4.1.4\python\lib\site-packages (2.13.1)

C:\IPED414\iped-4.1.4\python>pip install tensorflow Requirement already satisfied: tensorflow in c:\iped414\iped-4.1.4\python\lib\site-packages (2.13.0) Requirement already satisfied: tensorflow-intel==2.13.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow) (2.13.0) Requirement already satisfied: absl-py>=1.0.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (1.4.0) Requirement already satisfied: astunparse>=1.6.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (1.6.3) Requirement already satisfied: flatbuffers>=23.1.21 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (23.5.26) Requirement already satisfied: gast<=0.4.0,>=0.2.1 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (0.4.0) Requirement already satisfied: google-pasta>=0.1.1 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (0.2.0) Requirement already satisfied: h5py>=2.9.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (3.9.0) Requirement already satisfied: libclang>=13.0.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (16.0.6) Requirement already satisfied: numpy<=1.24.3,>=1.22 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (1.22.3) Requirement already satisfied: opt-einsum>=2.3.2 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (3.3.0) Requirement already satisfied: packaging in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (23.1) Requirement already satisfied: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (4.24.1) Requirement already satisfied: setuptools in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (68.1.2) Requirement already satisfied: six>=1.12.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (1.16.0) Requirement already satisfied: termcolor>=1.1.0 in c:\iped414\iped-4.1.4\python (from tensorflow-intel==2.13.0->tensorflow) (1.1.0) Requirement already satisfied: typing-extensions<4.6.0,>=3.6.6 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (4.5.0) Requirement already satisfied: wrapt>=1.11.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (1.15.0) Requirement already satisfied: grpcio<2.0,>=1.24.3 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (1.57.0) Requirement already satisfied: tensorboard<2.14,>=2.13 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (2.13.0) Requirement already satisfied: tensorflow-estimator<2.14,>=2.13.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (2.13.0) Requirement already satisfied: keras<2.14,>=2.13.1 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (2.13.1) Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorflow-intel==2.13.0->tensorflow) (0.31.0) Requirement already satisfied: wheel<1.0,>=0.23.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from astunparse>=1.6.0->tensorflow-intel==2.13.0->tensorflow) (0.41.1) Requirement already satisfied: google-auth<3,>=1.6.3 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (2.22.0) Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (1.0.0) Requirement already satisfied: markdown>=2.6.8 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (3.4.4) Requirement already satisfied: requests<3,>=2.21.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (2.31.0) Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (0.7.1) Requirement already satisfied: werkzeug>=1.0.1 in c:\iped414\iped-4.1.4\python\lib\site-packages (from tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (2.3.7) Requirement already satisfied: cachetools<6.0,>=2.0.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (5.3.1) Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\iped414\iped-4.1.4\python\lib\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (0.3.0) Requirement already satisfied: rsa<5,>=3.1.4 in c:\iped414\iped-4.1.4\python\lib\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (4.9) Requirement already satisfied: urllib3<2.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (1.26.16) Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (1.3.1) Requirement already satisfied: importlib-metadata>=4.4 in c:\iped414\iped-4.1.4\python\lib\site-packages (from markdown>=2.6.8->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (6.8.0) Requirement already satisfied: charset-normalizer<4,>=2 in c:\iped414\iped-4.1.4\python\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (3.2.0) Requirement already satisfied: idna<4,>=2.5 in c:\iped414\iped-4.1.4\python\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (3.4) Requirement already satisfied: certifi>=2017.4.17 in c:\iped414\iped-4.1.4\python\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (2023.7.22) Requirement already satisfied: MarkupSafe>=2.1.1 in c:\iped414\iped-4.1.4\python\lib\site-packages (from werkzeug>=1.0.1->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (2.1.3) Requirement already satisfied: zipp>=0.5 in c:\iped414\iped-4.1.4\python\lib\site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (3.16.2) Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in c:\iped414\iped-4.1.4\python\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (0.5.0) Requirement already satisfied: oauthlib>=3.0.0 in c:\iped414\iped-4.1.4\python\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow) (3.2.2)

Att,


Lúcio de C. Furtado


De: Luis Filipe Nassif @.> Enviado: sábado, 23 de setembro de 2023 11:32 Para: sepinf-inc/IPED @.> Cc: Lúcio Furtado @.>; Author @.> Assunto: Re: [sepinf-inc/IPED] The task NSFWNudityDetectTask.py does not run (Issue #1892)

What version of keras and tensorflow have you installed?

— Reply to this email directly, view it on GitHubhttps://github.com/sepinf-inc/IPED/issues/1892#issuecomment-1732331337, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOTJEBN4RPOEGZH7R5HO3ELX33XGHANCNFSM6AAAAAA5DNTSWI. You are receiving this because you authored the thread.Message ID: @.***>

lfcnassif commented 11 months ago

I was able to reproduce it with both tensorflow-2.5 and 2.14 with a CUDA device configured, probably a CUDA misconfiguration in my system (maybe in yours too..). Disabling it with command below before processing worked to run the module on CPU: set CUDA_VISIBLE_DEVICES=-1

Please test it.

lfcnassif commented 11 months ago

probably a CUDA misconfiguration in my system

Maybe it was caused by python library conflicts, because I had installed several different python libraries evaluating different Whisper implementations in the past. So I would also recommend installing and testing this module alone in a fresh IPED installation, without any of the other python modules installed.

Lucio-hub commented 10 months ago

It worked after the suggested "clean" installation, with only the 3 necessary modules, Keras, Tensorflow and Pillow.

Lucio-hub commented 10 months ago

However, if the FaceRecognition and Wav2Vec2 models are installed, YahooNSFWNudityDetection stops working. The problem is that I need the features provided by the mentioned facial recognition and audio transcription models, available in the IPED report.

MÓDULOS FaceRecognition e Wav2Vec2

lfcnassif commented 10 months ago

I think all modules used to work together in the past, probably some module new version needs a specific version of some library also used by another module, but a different version, causing conflicts.

I'll try to create a pre-built package with all those 3 python modules (YahooNSFW, FaceRecognition and Wav2Vec2 transcription) when I have some available time.

lfcnassif commented 10 months ago

Possibly related: https://github.com/ninia/jep/issues/434

lfcnassif commented 10 months ago

Just an update here, the issue is some incompatibility conflict between tensorflow-2.14 and huggindsound-0.1.6 (or some of their dependencies). I'm trying different versions of those libraries, maybe there is some combination that works...

But, for now, you should be able to install face_recognition and tensorflow-2.14 (used by Yahoo nudity detection) and to use the Wav2Vec2 transcription using the remote transcription setup instead of the local one, sending the transcription job to another machine (with your GPU card). See how to setup the remote transcription here: https://github.com/sepinf-inc/IPED/wiki/User-Manual#remote-transcription-service-side

PS: It is also possible to have 2 different IPED instances on the same computer. You can use one of them to install face recognition and tensorflow to run your processing jobs, and the second IPED instance you can use to install huggingsound and to use it to run a transcription service, which can be used by the first IPED instance.

Lucio-hub commented 10 months ago

Dear Nassif, I installed two instances, as suggested, but when running IPED from the first, I receive the error message that I can't find the huggingsound* models installed, asking if I installed them. How can I link the first instance to the second, so that IPED finds the files necessary to execute the audio transcription in the second instance?

lfcnassif commented 10 months ago

Hi @Lucio-hub,

https://github.com/sepinf-inc/IPED/wiki/User-Manual#remote-transcription-service-side

Have you followed steps above to setup a transcription service using the second IPED instance? After that, you need to do the "client side" steps into the first IPED instance: https://github.com/sepinf-inc/IPED/wiki/User-Manual#remote-transcription-client-side

Lucio-hub commented 10 months ago

Ok, I'll try!

Lucio-hub commented 9 months ago

Dear friends, I have another question: Can anyone help me with instructions on how to import the SQL files available on the NIST website into the IPED database? RDS_DELTA SQL

lfcnassif commented 9 months ago

In the discussions section there are some topics about it.

lfcnassif commented 9 months ago

Were you able to start 2 IPED instances to run Wav2vec2 + YahooNSFW?

Lucio-hub commented 9 months ago

Dear friend, I installed the two IPED instances on the same computer, as instructed, but I was unable to establish the link between them.

vitorlco commented 5 months ago

Good afternon. I am with the same problem. But When I tried set the module "enableYahooNSFWDetection = true" is show the message _"I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0."_ I tried set the environment variable and clear instalacion of python and modules, but task NSFWNudityDetectTask.py always freezes.

lfcnassif commented 5 months ago

Tensorflow+GPU is no longer supported on native Windows. Since I don't recommend running it without a good GPU, it is one of the reasons we deprecated Yahoo NSFW nudity detection and plan to replace it in the future by new module: https://github.com/sepinf-inc/IPED/issues/1076

Anyway, you may be able to run it using an old version of Tensorflow 2.10. If you want to run it together with Wav2Vec2, you should install wav2vec2 in a separate IPED copy in the same or another machine and setup a transcription service, as already recommended here: https://github.com/sepinf-inc/IPED/issues/1892#issuecomment-1754013300