JeffreyCA / spleeter-web

Self-hostable web app for isolating the vocal, accompaniment, bass, and drums of any song. Supports Spleeter, D3Net, Demucs, Tasnet, X-UMX. Built with React and Django.
https://jeffreyca.github.io/spleeter-web/
MIT License
413 stars 76 forks source link

`Not Found: /media/uploads/d95c0f2e-1507-4139-ad6e-494d1314558a/lizzi.mp3` #1073

Closed piwawa closed 2 months ago

piwawa commented 2 months ago
2024-05-01 02:23:44,240 [django.request][WARNING]: Not Found: /media/uploads/d95c0f2e-1507-4139-ad6e-494d1314558a/lizzi.mp3
[01/May/2024 02:23:44] "GET /media/uploads/d95c0f2e-1507-4139-ad6e-494d1314558a/lizzi.mp3 HTTP/1.1" 404 179
[01/May/2024 02:23:47] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:23:59] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:24:11] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:24:23] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:24:34] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:24:46] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:24:58] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:25:10] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:25:22] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:25:34] "GET /api/source-track/ HTTP/1.1" 200 293
^[[A^[[A^[[A^[[A^[[A[01/May/2024 02:26:11] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:26:23] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:26:35] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:26:47] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:26:59] "GET /api/source-track/ HTTP/1.1" 200 293
^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A^[[A[01/May/2024 02:30:42] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:38:13] "GET / HTTP/1.1" 200 584
[01/May/2024 02:38:14] "GET /api/source-track/ HTTP/1.1" 200 293
2024-05-01 02:38:19,235 [django.request][WARNING]: Not Found: /media/uploads/d95c0f2e-1507-4139-ad6e-494d1314558a/lizzi.mp3
[01/May/2024 02:38:19] "GET /media/uploads/d95c0f2e-1507-4139-ad6e-494d1314558a/lizzi.mp3 HTTP/1.1" 404 179
[01/May/2024 02:38:25] "GET /api/source-track/ HTTP/1.1" 200 293
[01/May/2024 02:38:30] "POST /api/mix/dynamic/ HTTP/1.1" 201 430
[01/May/2024 02:38:30] "GET /mixer/0bb1829e-65a5-46f4-b3b0-b707ad9eee50 HTTP/1.1" 301 0

I have uploaded the file on web:

image

image

I can't play music on web or separate any audio!!

piwawa commented 2 months ago

Deploy via https://github.com/JeffreyCA/spleeter-web#getting-started-without-docker

JeffreyCA commented 2 months ago

Can you try setting DEBUG = True in django_react/settings.py?

piwawa commented 2 months ago

Can you try setting DEBUG = True in django_react/settings.py?

After setting DEBUG = True, It worked!

image

But the processing time is very long, almost 5 minutes for Demucs v4 Fine-tuned and Demucs v4.

I found it not using GPUs during processing (the processes are others):

(cu118) (cu118) [bingo06@zernithos ~]$ nvidia-smi
Wed May  1 21:25:14 2024       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.14              Driver Version: 550.54.14      CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2080 Ti     Off |   00000000:1A:00.0 Off |                  N/A |
| 27%   34C    P8              5W /  250W |     414MiB /  11264MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  NVIDIA GeForce RTX 4090        Off |   00000000:68:00.0 Off |                  Off |
|  0%   38C    P8              4W /  450W |    5427MiB /  24564MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      1798      C   python3                                       154MiB |
|    0   N/A  N/A    939429      C   python                                        256MiB |
|    1   N/A  N/A      1798      C   python3                                      4930MiB |
|    1   N/A  N/A    939429      C   python                                        486MiB |
+-----------------------------------------------------------------------------------------+

How to set CUDA device?

JeffreyCA commented 2 months ago

GPU separation isn't officially supported on non-Docker setups - I would consider using Docker

Can you try setting the environment variable CPU_SEPARATION=0? If that doesn't work, try installing these Python dependencies:

pip install torch==1.13.1+cu116 torchaudio==0.13.1+cu116 -f https://download.pytorch.org/whl/torch_stable.html
piwawa commented 2 months ago

GPU separation isn't officially supported on non-Docker setups - I would consider using Docker

Can you try setting the environment variable CPU_SEPARATION=0? If that doesn't work, try installing these Python dependencies:

pip install torch==1.13.1+cu116 torchaudio==0.13.1+cu116 -f https://download.pytorch.org/whl/torch_stable.html

Still not using GPU. Does it use the following code after running python manage.py collectstatic && python manage.py runserver 127.0.0.1:8000 image

JeffreyCA commented 2 months ago

It should, but it's the Celery worker that needs to be restarted:

celery -A api worker -l INFO -Q slow_queue -c 1

What if you manually change that line of code to self.device = 'cuda'?

piwawa commented 2 months ago

It should, but it's the Celery worker that needs to be restarted:

celery -A api worker -l INFO -Q slow_queue -c 1

What if you manually change that line of code to self.device = 'cuda'?

After restarting this process celery -A api worker -l INFO -Q slow_queue -c 1, it successfully called GPU! I can get fast segmentation now!

But i have another problem, how to make this label display completely as 'Accompaniment'?

image

JeffreyCA commented 2 months ago

Great! You can change the text here:

https://github.com/JeffreyCA/spleeter-web/blob/9dd9007576a728768d175b1eb97ae2725281f384/frontend/src/components/Badges.tsx#L45-L52

piwawa commented 2 months ago

I just simply changed the part to this:

 export const AccompShortBadge = (props: BadgeProps): JSX.Element => { 
   const { faded, title } = props; 
   return ( 
     <Badge pill className={props.className} variant={faded ? 'accomp-faded' : 'accomp'} title={title}> 
       Accompaniment
     </Badge> 
   ); 
 }; 

And i got this display effect:

image

Obviously it doesn't looks good, how to make the label fit this text?

JeffreyCA commented 2 months ago

You can play around with the width here:

https://github.com/JeffreyCA/spleeter-web/blob/9dd9007576a728768d175b1eb97ae2725281f384/frontend/src/components/Mixer/VolumeUI.css#L53-L56