Closed hagenw closed 4 years ago
Are you sure that it's hitting the memory error on the GPU? To me, it looks like it is Norbert (meaning the wiener filter on CPU). Can you try running the same example with --niter 0
on the same machine?
You are right, I get the same error on the CPU:
>>> python test.py ~/data/musdb18/musdb18-wav/test/Al\ James\ -\ Schoolboy\ Facination/mixture.wav --model umx --no-cuda
Traceback (most recent call last):
File "test.py", line 301, in <module>
device=device
File "test.py", line 166, in separate
use_softmask=softmask)
File "/home/audeering.local/hwierstorf/.anaconda3/envs/open-unmix-pytorch-linux-cpu/lib/python3.7/site-packages/norbert/__init__.py", line 260, in wiener
y = expectation_maximization(y/max_abs, x_scaled, iterations, eps=eps)[0]
File "/home/audeering.local/hwierstorf/.anaconda3/envs/open-unmix-pytorch-linux-cpu/lib/python3.7/site-packages/norbert/__init__.py", line 141, in expectation_maximization
eps)
File "/home/audeering.local/hwierstorf/.anaconda3/envs/open-unmix-pytorch-linux-cpu/lib/python3.7/site-packages/norbert/__init__.py", line 511, in get_local_gaussian_model
C_j = _covariance(y_j)
File "/home/audeering.local/hwierstorf/.anaconda3/envs/open-unmix-pytorch-linux-cpu/lib/python3.7/site-packages/norbert/__init__.py", line 468, in _covariance
y_j.dtype)
MemoryError
I tested with --niter 0
and it worked, thanks.
I have 16GB of RAM which seems to be reasonable, so maybe you add the --niter 0
hint to the first example as well?
I have 16GB of RAM which seems to be reasonable,
Interestingly, .I tried to run the same example on my laptop (OSX, 8GB of RAM) and it worked fine (with some swapping).
so maybe you add the --niter 0 hint to the first example as well?
in any case I will add a note in the readme. We also plan to improve the RAM usage of norbert soon, maybe you are interested in helping out?
I have to admit, I'm using 6GB by other programs, so it's not really 16GB available here ;)
I would love to work a little bit more on source separation at the moment, but I'm afraid I will not really have time this year.
Feel free to close this issue, after adding a comment to the README.
Can confirm, I have a server with 16GB ram out of which 14GB was available when executing.
It was always getting killed when I executed just test.py
but worked with --niter=0
.
I was wondering if that significantly affects the quality of the output? If not then maybe it could be made the default?
(open-unmix-pytorch-linux-cpu) aadibajpai@ubuntu_hydralatest:~/open-unmix-pytorch$ python test.py photograph.wav
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [01:06<00:00, 16.82s/it]
Killed
(open-unmix-pytorch-linux-cpu) aadibajpai@ubuntu_hydralatest:~/open-unmix-pytorch$ python test.py photograph.wav --niter=0
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [01:08<00:00, 17.06s/it]
I was wondering if that significantly affects the quality of the output?
yes. The difference on MUSDB18 is about 0.3 dB SDR (vocals), which is significant, so we want keep the wiener filter in the post-processing by default.
If not then maybe it could be made the default?
I will add a comment in the docs/readme as proposed by @hagenw. Also I think it makes sense to add a start
and duration
argument to the separation function, allowing to crop the input, thus saving memory.
I was wondering if that significantly affects the quality of the output?
yes. The difference on MUSDB18 is about 0.3 dB SDR (vocals), which is significant, so we want keep the wiener filter in the post-processing by default.
That's a lot, in that case do you know why it fails on decent specs? I'm very impressed by the results with niter=0
so can only imagine how well it would work with it. Also, when talking of SDR/SAR/SIR values, higher is better, right?
If not then maybe it could be made the default?
I will add a comment in the docs/readme as proposed by @hagenw. Also I think it makes sense to add a
start
andduration
argument to the separation function, allowing to crop the input, thus saving memory.
That's fair enough but maybe not very useful when you need to work with full length tracks (such as in my case)
I modified the norbert package through this pull request
this should make the memory usage smaller @hagenw @aadibajpai could you try it again with the new norbert, through:
pip install norbert==0.2.1
I modified the norbert package through this pull request
this should make the memory usage smaller @hagenw @aadibajpai could you try it again with the new norbert, through:
pip install norbert==0.2.1
worked!
@hagenw did you had time to test this on your machine?
It's working for me now.
But I agree that it would be nice to have something like start
and duration
arguments. Or maybe the possibility in the long run to integrate some block-processing internally.
But I agree that it would be nice to have something like start and duration arguments
@hagenw have a look at #10 and feel free to review that one.
Or maybe the possibility in the long run to integrate some block-processing internally.
For bidirectional models that would reduce the performance significantly. Do you think an overlap-add would be sufficient here for test time?
In any case, the unidirectional model would not suffer from that.
But I agree that it would be nice to have something like start and duration arguments. Or maybe the possibility in the long run to integrate some block-processing internally.
start
and duration
have been merged in #10
@hagenw can this be closed?
@hagenw feel free to reopen if you have further comments
🐛 Bug
It seems to be relatively easy to get out of memory for the first example provided in the
README
on the GPU. Maybe it would be nice to add some hardware requirements or estimation how much memory you need per second of input signal.To Reproduce
Steps to reproduce the behavior:
Environment
Please add some information about your environment
If unsure you can paste the output from the pytorch environment collection script (or fill out the checklist below manually).
You can get that script and run it with: