Merge pull request #83568 from bhipple/rm/torch

treewide: remove torch and related packages
This commit is contained in:
worldofpeace 2020-03-28 01:40:35 -04:00 committed by GitHub
commit 2b1f4f314e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 1 additions and 271 deletions

View File

@ -1,19 +0,0 @@
{stdenv, fetchFromGitHub, cmake, torch, protobuf, protobufc}:
stdenv.mkDerivation rec {
pname = "loadcaffe";
version = "0.0pre2016.08.01";
buildInputs = [cmake torch protobuf protobufc];
src = fetchFromGitHub {
owner = "szagoruyko";
repo = "loadcaffe";
rev = "9be65cf6fa08e9333eae3553f68a8082debe9978";
sha256 = "0b22hvd9nvjsan2h93nl6y34kkkbs36d0k1zr3csjfb5l13xz0lh";
};
meta = {
inherit version;
description = ''Torch7 loader for Caffe networks'';
license = stdenv.lib.licenses.bsd2 ;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,19 +0,0 @@
{stdenv, fetchFromGitHub, torch, cmake, hdf5}:
stdenv.mkDerivation rec {
pname = "torch-hdf5";
version = "0.0pre2016-07-01";
buildInputs = [cmake torch hdf5];
src = fetchFromGitHub {
owner = "deepmind";
repo = "torch-hdf5";
rev = "639bb4e62417ac392bf31a53cdd495d19337642b";
sha256 = "0x1si2c30d95vmw0xqyq242wghfih3m5i43785vwahlzm7h6n6xz";
};
meta = {
inherit version;
description = ''HDF5 format support for Torch'';
license = stdenv.lib.licenses.bsd3;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
};
}

View File

@ -1,38 +0,0 @@
{stdenv, fetchgit, luajit, openblas, imagemagick, cmake, curl, fftw, gnuplot
, libjpeg, zeromq3, ncurses, openssl, libpng, qt4, readline, unzip
, pkgconfig, zlib, libX11, which
}:
stdenv.mkDerivation rec{
version = "0.0pre20160820";
pname = "torch";
buildInputs = [
luajit openblas imagemagick cmake curl fftw gnuplot unzip qt4
libjpeg zeromq3 ncurses openssl libpng readline pkgconfig
zlib libX11 which
];
src = fetchgit {
url = "https://github.com/torch/distro";
rev = "8b6a834f8c8755f6f5f84ef9d8da9cfc79c5ce1f";
sha256 = "120hnz82d7izinsmv5smyqww71dhpix23pm43s522dfcglpql8xy";
fetchSubmodules = true;
};
buildPhase = ''
cd ..
export PREFIX=$out
mkdir "$out"
sh install.sh -s
'';
installPhase = ''
'';
meta = {
inherit version;
description = ''A scientific computing framework with wide support for machine learning algorithms'';
license = stdenv.lib.licenses.bsd3 ;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
broken = true;
};
}

View File

@ -1,63 +0,0 @@
{stdenv, fetchFromGitHub, fetchurl, torch, torch-hdf5, loadcaffe, bash
, python, numpy, scipy, h5py, scikitlearn, pillow
}:
stdenv.mkDerivation rec {
pname = "fast-neural-doodle";
version = "0.0pre2016-07-01";
buildInputs = [
torch torch-hdf5 python numpy h5py scikitlearn scipy pillow
];
inherit torch loadcaffe bash python;
torch_hdf5 = torch-hdf5;
python_libPrefix = python.libPrefix;
src = fetchFromGitHub {
owner = "DmitryUlyanov";
repo = "fast-neural-doodle";
rev = "00c35a4440d1d58b029d7bdf9bc56743b1a1835f";
sha256 = "0xhmhxhjm59pfjm2q27g2xfb35hg0vlqkk3sb3llx2qqq2c7jk8m";
};
models = [
(fetchurl {
url = "https://gist.githubusercontent.com/ksimonyan/3785162f95cd2d5fee77/raw/bb2b4fe0a9bb0669211cf3d0bc949dfdda173e9e/VGG_ILSVRC_19_layers_deploy.prototxt";
sha256 = "09cpz7pyvc8sypg2q5j2i8yqwj1sjdbnmd6skl293p9pv13dmjg7";
})
(fetchurl {
url = "https://bethgelab.org/media/uploads/deeptextures/vgg_normalised.caffemodel";
sha256 = "11qckdvlck7wwl3pan0nawgxm8l2ccddi272i5l8rs9qzm7b23rf";
})
(fetchurl {
url = "http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_19_layers.caffemodel";
sha256 = "0m399x7pl4lnhy435ycsyz8xpzapqmx9n1sz698y2vhcqhkwdd1i";
})
];
installPhase = ''
mkdir -p "$out"/{doc/fast-neural-doodle,lib/lua/fast_neural_doodle,lib/${python.libPrefix}/fast_neural_doodle,bin}
cp -r data src fast_neural_doodle.lua "$out/lib/lua/fast_neural_doodle/"
for file in $models; do
ln -s "$file" "$out/lib/lua/fast_neural_doodle/data/pretrained/$(basename "$file" | sed -e 's/[^-]*-//')"
done;
cp get_mask_hdf5.py "$out/lib/${python.libPrefix}/fast_neural_doodle"
cp *.md LICENSE "$out/doc/fast-neural-doodle"
export pythonpath="$PYTHONPATH"
substituteAll "${./get-mask-hdf5.sh}" "$out/bin/get-mask-hdf5"
substituteAll "${./fast-neural-doodle.sh}" "$out/bin/fast-neural-doodle"
chmod a+x "$out/bin"/*
"$out/bin/get-mask-hdf5" --n_colors=4 --style_image data/Renoir/style.png --style_mask data/Renoir/style_mask.png --target_mask data/Renoir/target_mask.png --out_hdf5 masks.hdf5
"$out/bin/fast-neural-doodle" -gpu -1 -masks_hdf5 masks.hdf5 -num_iterations 1
'';
meta = {
inherit version;
description = ''Faster neural doodle'';
license = stdenv.lib.licenses.mit;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
broken = true;
};
}

View File

@ -1,28 +0,0 @@
#! @bash@/bin/bash
declare -a args
c=1
flag=
for arg in "$@"; do
if test "$arg" = "${arg#-}" && test "$arg" = "${arg#/}" && test -n "$flag"; then
arg="$PWD/$arg"
flag=
elif (test "$arg" != "${arg%_image}" || test "$arg" == "-masks_hdf5") && test "$arg" != "${arg#-}"; then
flag=1
else
flag=
fi
args[c]="$arg";
c=$((c+1));
done
cd "@out@/lib/lua/fast_neural_doodle"
export LUA_PATH="$LUA_PATH${LUA_PATH:+;}@loadcaffe@/lua/?/init.lua;@loadcaffe@/lua/?.lua"
export LUA_PATH="$LUA_PATH${LUA_PATH:+;}@torch_hdf5@/lua/?/init.lua;@torch_hdf5@/lua/?.lua"
export LUA_CPATH="$LUA_CPATH${LUA_CPATH:+;}@loadcaffe@/lib/?.so"
set -x
@torch@/bin/th fast_neural_doodle.lua "${args[@]}"

View File

@ -1,5 +0,0 @@
#! @bash@/bin/bash
export PYTHONPATH="@pythonpath@"
@python@/bin/python "@out@/lib/@python_libPrefix@/fast_neural_doodle/get_mask_hdf5.py" "$@"

View File

@ -1,58 +0,0 @@
{stdenv, fetchFromGitHub, torch, loadcaffe, fetchurl, bash}:
stdenv.mkDerivation rec {
pname = "neural-style";
version = "0.0pre2016.08.15";
buildInputs = [torch loadcaffe];
src = fetchFromGitHub {
owner = "jcjohnson";
repo = "neural-style";
rev = "ec5ba3a690d3090428d3b92b0c5d686a311bf432";
sha256 = "14qzbs9f95izvd0vbbirhymdw9pq2nw0jvhrh7vnyzr99xllwp02";
};
models = [
(fetchurl {
url = "https://gist.githubusercontent.com/ksimonyan/3785162f95cd2d5fee77/raw/bb2b4fe0a9bb0669211cf3d0bc949dfdda173e9e/VGG_ILSVRC_19_layers_deploy.prototxt";
sha256 = "09cpz7pyvc8sypg2q5j2i8yqwj1sjdbnmd6skl293p9pv13dmjg7";
})
(fetchurl {
url = "https://bethgelab.org/media/uploads/deeptextures/vgg_normalised.caffemodel";
sha256 = "11qckdvlck7wwl3pan0nawgxm8l2ccddi272i5l8rs9qzm7b23rf";
})
(fetchurl {
url = "http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_19_layers.caffemodel";
sha256 = "0m399x7pl4lnhy435ycsyz8xpzapqmx9n1sz698y2vhcqhkwdd1i";
})
];
installPhase = ''
mkdir -p "$out"/{bin,lib/lua/neural-style/models,share/doc/neural-style,share/neural-style}
for file in $models; do
ln -s "$file" "$out/lib/lua/neural-style/models/$(basename "$file" | sed -e 's/[^-]*-//')"
done;
cp README* INSTALL* LICEN?E* "$out"/share/doc/neural-style/
cp neural_style.lua "$out"/lib/lua/neural-style
substituteAll "${./neural-style.sh}" "$out/bin/neural-style"
chmod a+x "$out/bin/neural-style"
cp "$out/bin/neural-style" .
cp "$out/lib/lua/neural-style/models/"* models/
echo "Testing..."
"$out/bin/neural-style" -style_image examples/inputs/golden_gate.jpg \
-content_image examples/inputs/golden_gate.jpg -output_image $PWD/test.png \
-gpu -1 -save_iter 1 -print_iter 1 -num_iterations 1 || true
cp -f "$out/lib/lua/neural-style/models/"* models/
test -e test.png || exit 1
'';
inherit torch bash loadcaffe;
meta = {
inherit version;
description = ''A torch implementation of the paper A Neural Algorithm of Artistic Style'';
license = stdenv.lib.licenses.mit ;
maintainers = [stdenv.lib.maintainers.raskin];
# Eats a lot of RAM
platforms = ["x86_64-linux"];
};
}

View File

@ -1,25 +0,0 @@
#! @bash@/bin/bash
declare -a args
c=1
flag=
for arg in "$@"; do
if test "$arg" = "${arg#-}" && test "$arg" = "${arg#/}" && test -n "$flag"; then
arg="$PWD/$arg"
flag=
elif test "$arg" != "${arg%_image}" && test "$arg" != "${arg#-}"; then
flag=1
else
flag=
fi
args[c]="$arg";
c=$((c+1));
done
cd "@out@/lib/lua/neural-style"
export LUA_PATH="$LUA_PATH${LUA_PATH:+;}@loadcaffe@/lua/?/init.lua;@loadcaffe@/lua/?.lua"
export LUA_CPATH="$LUA_CPATH${LUA_CPATH:+;}@loadcaffe@/lib/?.so"
@torch@/bin/th neural_style.lua "${args[@]}"

View File

@ -3313,11 +3313,6 @@ in
fakechroot = callPackage ../tools/system/fakechroot { };
fast-neural-doodle = callPackage ../tools/graphics/fast-neural-doodle {
inherit (python27Packages) numpy scipy h5py scikitlearn python
pillow;
};
fastpbkdf2 = callPackage ../development/libraries/fastpbkdf2 { };
fanficfare = callPackage ../tools/text/fanficfare { };
@ -5378,8 +5373,6 @@ in
netcdffortran = callPackage ../development/libraries/netcdf-fortran { };
neural-style = callPackage ../tools/graphics/neural-style {};
nco = callPackage ../development/libraries/nco { };
ncftp = callPackage ../tools/networking/ncftp { };
@ -13583,8 +13576,6 @@ in
live555 = callPackage ../development/libraries/live555 { };
loadcaffe = callPackage ../development/libraries/loadcaffe {};
log4cpp = callPackage ../development/libraries/log4cpp { };
log4cxx = callPackage ../development/libraries/log4cxx { };
@ -14816,12 +14807,6 @@ in
tokyotyrant = callPackage ../development/libraries/tokyo-tyrant { };
torch = callPackage ../development/libraries/torch {
openblas = openblasCompat;
};
torch-hdf5 = callPackage ../development/libraries/torch-hdf5 {};
totem-pl-parser = callPackage ../development/libraries/totem-pl-parser { };
tpm2-tss = callPackage ../development/libraries/tpm2-tss { };
@ -23710,7 +23695,7 @@ in
multimc = libsForQt5.callPackage ../games/multimc { };
inherit (callPackages ../games/minetest {
inherit (darwin) libiconv;
inherit (darwin) libiconv;
inherit (darwin.apple_sdk.frameworks) OpenGL OpenAL Carbon Cocoa;
})
minetestclient_4 minetestserver_4