2021-04-26 19:14:03 +00:00
|
|
|
{ boto3
|
|
|
|
, buildPythonPackage
|
|
|
|
, crc32c
|
2022-01-13 20:06:32 +00:00
|
|
|
, which
|
2021-04-26 19:14:03 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, matplotlib
|
|
|
|
, moto
|
|
|
|
, numpy
|
|
|
|
, pillow
|
2022-10-06 18:32:54 +00:00
|
|
|
, protobuf
|
2021-04-26 19:14:03 +00:00
|
|
|
, pytestCheckHook
|
2022-09-09 14:08:57 +00:00
|
|
|
, torch
|
2021-04-26 19:14:03 +00:00
|
|
|
, six
|
|
|
|
, soundfile
|
2022-04-15 01:41:22 +00:00
|
|
|
, tensorboard
|
2021-04-26 19:14:03 +00:00
|
|
|
, torchvision
|
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tensorboardx";
|
2022-10-06 18:32:54 +00:00
|
|
|
version = "2.5.1";
|
|
|
|
format = "setuptools";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lanpa";
|
|
|
|
repo = "tensorboardX";
|
2022-10-06 18:32:54 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-Np0Ibn51qL0ORwq1IY8lUle05MQDdb5XkI1uzGOKJno=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
# apparently torch API changed a bit at 1.6
|
|
|
|
postPatch = ''
|
2021-04-26 19:14:03 +00:00
|
|
|
substituteInPlace tensorboardX/pytorch_graph.py --replace \
|
|
|
|
"torch.onnx.set_training(model, False)" \
|
|
|
|
"torch.onnx.select_model_mode_for_export(model, torch.onnx.TrainingMode.EVAL)"
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
# Version detection seems broken here, the version reported by python is
|
|
|
|
# newer than the protobuf package itself.
|
|
|
|
sed -i -e "s/'protobuf[^']*'/'protobuf'/" setup.py
|
2020-11-12 09:05:59 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
which
|
|
|
|
protobuf
|
|
|
|
];
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
# required to make tests deterministic
|
|
|
|
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
crc32c
|
|
|
|
numpy
|
|
|
|
six
|
|
|
|
soundfile
|
|
|
|
];
|
2020-11-12 09:05:59 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
checkInputs = [
|
|
|
|
boto3
|
|
|
|
matplotlib
|
|
|
|
moto
|
|
|
|
pillow
|
|
|
|
pytestCheckHook
|
2022-09-09 14:08:57 +00:00
|
|
|
torch
|
2022-04-15 01:41:22 +00:00
|
|
|
tensorboard
|
2021-04-26 19:14:03 +00:00
|
|
|
torchvision
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# ImportError: Visdom visualization requires installation of Visdom
|
|
|
|
"test_TorchVis"
|
|
|
|
# Requires network access (FileNotFoundError: [Errno 2] No such file or directory: 'wget')
|
|
|
|
"test_onnx_graph"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# we are not interested in linting errors
|
|
|
|
"tests/test_lint.py"
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for writing tensorboard-compatible logs";
|
|
|
|
homepage = "https://github.com/lanpa/tensorboardX";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ lebastr akamaus ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|