davidmartinrius / speech-dataset-generator

🔊 Create labeled datasets, enhance audio quality, identify speakers, support diverse dataset types. 🎧👥📊 Advanced audio processing.
MIT License
170 stars 17 forks source link

No module named 'speech_dataset_generator' #7

Closed MethanJess closed 3 months ago

MethanJess commented 3 months ago

I have installed this repository using WSL2 and all the requirements. However, whenever I input this in, python speech_dataset_generator/main.py --input_file_path /audpath/myVoice.wav --output_directory /output --range_times 5-10 --datasets metavoice

I would get this error ModuleNotFoundError: No module named 'speech_dataset_generator' I fixed this error by manually doing pip install speech_dataset_generator But now I recive this error:

Traceback (most recent call last):
  File "/home/plamyam/speech-dataset-generator/speech_dataset_generator/main.py", line 3, in <module>
    from speech_dataset_generator.audio_processor.audio_processor import process_audio_files, get_local_audio_files, get_youtube_audio_files, get_librivox_audio_files, get_tedtalks_audio_files
ImportError: cannot import name 'get_librivox_audio_files' from 'speech_dataset_generator.audio_processor.audio_processor' (/home/plamyam/speech-dataset-generator/venv/lib/python3.10/site-packages/speech_dataset_generator/audio_processor/audio_processor.py)
davidmartinrius commented 3 months ago

Hi @MethanJess ! Please, do not install it from PyPi because it is not ready yet. Install it from requirements.txt or setup.py

MethanJess commented 3 months ago

Hi @MethanJess ! Please, do not install it from PyPi because it is not ready yet. Install it from requirements.txt or setup.py

Hi, I just uninstalled the PyPi version, I have already installed requirements.txt, but i did it again (everything was successful), and, I still get the "No module named 'speech_dataset_generator'" error.

Traceback (most recent call last):
  File "/home/plamyam/speech-dataset-generator/speech_dataset_generator/main.py", line 3, in <module>
    from speech_dataset_generator.audio_processor.audio_processor import process_audio_files, get_local_audio_files, get_youtube_audio_files, get_librivox_audio_files, get_tedtalks_audio_files
ModuleNotFoundError: No module named 'speech_dataset_generator'
davidmartinrius commented 3 months ago

I could reproduce the problem. I am looking for a solution. I have never had this problem because I execute the next command inside the cloned project folder:

python speech_dataset_generator/main.py --input_file_path /audpath/myVoice.wav --output_directory /output --range_times 5-10 --datasets metavoice

But when executing the script from any other folder I get the same error as you told.

Well, it is just to let you know that I am looking for a way. As soon as possible I will provide a solution. You can try executing the script from the project folder as a workaround.

davidmartinrius commented 3 months ago

please, can you try doing this in the command line: export PYTHONPATH=/path/to/your/speech-dataset-generator:$PYTHONPATH

and then execute:

python speech_dataset_generator/main.py --input_file_path /audpath/myVoice.wav --output_directory /output --range_times 5-10 --datasets metavoice

I made it work this way.

Plase, let me know if you succeeded

MethanJess commented 3 months ago

Thank you! the the command you gave have fixed the issue.

However, I am getting this error now...

 File "/home/plamyam/speech-dataset-generator/venv/lib/python3.10/site-packages/keras/src/backend/tensorflow/nn.py", line 25, in sigmoid

JIT compilation failed.
         [[{{node functional_1_1/bidirectional_1/forward_lstm_1/while/lstm_cell_1/Sigmoid}}]] [Op:__inference_one_step_on_data_distributed_44142]

Not sure if this is related, but, I was also receiving this error PermissionError: [Errno 13] Permission denied: '/output' I fixed it by inputting the whole directory --output_directory "\\wsl.localhost\Ubuntu-22.04\home\plamyam\speech-dataset-generator\Output"

davidmartinrius commented 3 months ago

Ok two things:

  1. Do you have GPU and CUDA available inside the WSL2? Probably you don't and you need to install it yet. This project requires CUDA enabled... On the other hand, why don't you use it on Windows? Actually I haven't tried it on windows, but there should not be any problem with that.

  2. PermissionError: [Errno 13] Permission denied: '/output' is the folder "output" in the root of your file system (probably even it does not exist) If you wanted to use a relative path you should use --output_directory ./output (with the dot before the slash to tell the system that the output folder is in the current folder you are executing the script)

MethanJess commented 3 months ago

I do have Cuda installed and available on WSL2, and i do have a GPU that is detected by WSL.

The reason I didn't use windows is because I was getting errors related to deepspeed on Windows, I could open an issue for that if you would like.

MethanJess commented 3 months ago

Also, as a note, each time I close and re-open my WSL, I have to put in the export PYTHONPATH=/path/to/your/speech-dataset-generator:$PYTHONPATH command again.

davidmartinrius commented 3 months ago

Also, as a note, each time I close and re-open my WSL, I have to put in the export PYTHONPATH=/path/to/your/speech-dataset-generator:$PYTHONPATH command again.

You can add the export inside /home/your_user/.bashrc or the bash you are currently using to make it permanent. First you add it and then you have to do:

source /home/your_user/.bashrc or logout and login again with the user.

davidmartinrius commented 3 months ago

Also, as a note, each time I close and re-open my WSL, I have to put in the export PYTHONPATH=/path/to/your/speech-dataset-generator:$PYTHONPATH command again.

I can't reproduce the issue right now because I do not have a WSL ready yet. You will need to wait a little. I didn't make it work with WSL and this project. Can you show me the result of nvcc --version ?

If you'd like to open another issue for Windows it is ok.

MethanJess commented 3 months ago

Results:

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2021 NVIDIA Corporation Built on Thu_Nov_18_09:45:30_PST_2021 Cuda compilation tools, release 11.5, V11.5.119 Build cuda_11.5.r11.5/compiler.30672275_0

davidmartinrius commented 3 months ago

I recommend you to install it from a fresh environment.. if you did pip install speech_dataset_generator in the same environment and then installed it from requirements.txt again there could be some issues. If after installing the project in a new environment you still have the same issue. Please, could you try export TF_DISABLE_JIT=1

I am not sure if it will fix the problem, I'm walking blind by now.

"Disable JIT Compilation: You can try disabling JIT compilation in TensorFlow by setting the environment variable TF_DISABLE_JIT=1 before running your code. This will bypass JIT compilation and might help identify whether the issue is related to JIT."

MethanJess commented 3 months ago

Just re-installed everything on a new fresh environment and all of that, i still got the JIT error I then did export TF_DISABLE_JIT=1, and still got the error, really not sure why so, I will now open a new issue for the Windows deepspeed problem in case the JIT error thing is a WSL specific problem.