facebookresearch / demucs

Code for the paper Hybrid Spectrogram and Waveform Source Separation
MIT License
8.38k stars 1.07k forks source link

Conda installation broken #614

Open patrikohlsson opened 3 months ago

patrikohlsson commented 3 months ago

🐛 Bug Report

Installing demucs on the latest miniconda version is broken as conda is defaulting to numpy>=2. Some code in the musdb package seems to rely on numpy v1 functionality.

Adding numpy<2 to environment-cuda.yml appears to fix the issue.

To Reproduce

A simple Dockerfile that reproduces the error:

FROM ubuntu:latest

# Get deps for installing miniconda and demucs
RUN apt update -y && apt install wget git soundstretch -y

# Get and install miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py312_24.5.0-0-Linux-x86_64.sh
RUN bash Miniconda3-py312_24.5.0-0-Linux-x86_64.sh -b -p /miniconda3

ENV PATH="/miniconda3/bin:$PATH"

# Make sure base is up to date
RUN conda update -n base conda -y

# Clone and install demucs
RUN git clone https://github.com/facebookresearch/demucs

RUN cd demucs && conda env update -f environment-cuda.yml

RUN cd demucs && conda run -n demucs pip install -e .

# A simple import will trigger the exception
RUN conda run -n demucs python -c "from demucs.wav import Wavset"

# >> AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.

Your Environment