2021-04-15 01:04:25 +01:00
|
|
|
{ boto3
|
|
|
|
, buildPythonPackage
|
|
|
|
, crc32c
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, matplotlib
|
|
|
|
, moto
|
|
|
|
, numpy
|
|
|
|
, pillow
|
|
|
|
, protobuf
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytorch
|
|
|
|
, six
|
|
|
|
, soundfile
|
|
|
|
, tensorflow-tensorboard
|
|
|
|
, torchvision
|
|
|
|
}:
|
2019-01-04 21:20:43 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tensorboardx";
|
2021-03-24 17:41:57 +00:00
|
|
|
version = "2.1";
|
2019-01-04 21:20:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lanpa";
|
|
|
|
repo = "tensorboardX";
|
|
|
|
rev = "v${version}";
|
2021-03-24 17:41:57 +00:00
|
|
|
sha256 = "1palz91y0b39pcmwg6wdmqfal38hai99dd6r88i3imqxdbmjghih";
|
2019-01-04 21:20:43 +00:00
|
|
|
};
|
|
|
|
|
2020-09-05 21:46:04 +01:00
|
|
|
# apparently torch API changed a bit at 1.6
|
|
|
|
postPatch = ''
|
2021-04-15 01:04:25 +01: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)"
|
2020-09-05 21:46:04 +01:00
|
|
|
'';
|
|
|
|
|
2021-04-15 01:04:25 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
crc32c
|
|
|
|
numpy
|
|
|
|
protobuf
|
|
|
|
six
|
|
|
|
soundfile
|
|
|
|
];
|
2020-09-05 21:46:04 +01:00
|
|
|
|
2021-04-15 01:04:25 +01:00
|
|
|
checkInputs = [
|
|
|
|
boto3
|
|
|
|
matplotlib
|
|
|
|
moto
|
|
|
|
pillow
|
|
|
|
pytestCheckHook
|
|
|
|
pytorch
|
|
|
|
tensorflow-tensorboard
|
|
|
|
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"
|
|
|
|
];
|
2019-01-04 21:20:43 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for writing tensorboard-compatible logs";
|
2020-06-30 08:59:39 +01:00
|
|
|
homepage = "https://github.com/lanpa/tensorboardX";
|
2019-01-04 21:20:43 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ lebastr akamaus ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|