diff --git a/Dockerfile b/Dockerfile index c842dbb..c25371b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,8 @@ RUN curl -o Miniconda3-latest-Linux-x86_64.sh https://repo.continuum.io/minicond && ./Miniconda3-latest-Linux-x86_64.sh -b -p "${MINICONDA_HOME}" \ && rm Miniconda3-latest-Linux-x86_64.sh COPY conda.txt conda.txt -RUN conda install -y --file=conda.txt -RUN conda clean -y -i -l -p -t && \ +RUN conda install -y --file=conda.txt && \ + conda clean -y -i -l -p -t && \ rm -f conda.txt COPY pip.txt pip.txt RUN pip install -r pip.txt && \ diff --git a/conda.txt b/conda.txt index 24ce15a..22773da 100644 --- a/conda.txt +++ b/conda.txt @@ -1 +1 @@ -numpy +numpy==1.15.3 diff --git a/neuralstyle/algorithms.py b/neuralstyle/algorithms.py index 79976e3..1dfba59 100644 --- a/neuralstyle/algorithms.py +++ b/neuralstyle/algorithms.py @@ -351,7 +351,11 @@ def targetshape(content, size=None): def gpuname(): """Returns the model name of the first available GPU""" - gpus = GPUtil.getGPUs() + try: + gpus = GPUtil.getGPUs() + except: + LOGGER.warning("Unable to detect GPU model. Is your GPU configured? Are you running with nvidia-docker?") + return "UNKNOWN" if len(gpus) == 0: raise ValueError("No GPUs detected in the system") return gpus[0].name @@ -365,6 +369,6 @@ def maxtile(alg="gatys"): """ gname = gpuname() if gname not in GPUCONFIG: - LOGGER.warning("Unknown GPU model %s, will use default tiling parameters") + LOGGER.warning(f"Unknown GPU model {gname}, will use default tiling parameters") gname = "default" return GPUCONFIG[gname][alg] diff --git a/pip.txt b/pip.txt index 7ee527d..53b3f19 100644 --- a/pip.txt +++ b/pip.txt @@ -1 +1 @@ -gputil +gputil==1.3.0