mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
python3Packages.tensorboardx: fix build
Adds missing optional soundfile dependency, that was ultimately required during tests. Move crc32 into propagatedBuildInputs. Both changes were recommended here: https://github.com/lanpa/tensorboardX/blob/v2.1/README.md#install Clean up the package, disable linting tests.
This commit is contained in:
parent
a812d1b7af
commit
f29e513834
1 changed files with 49 additions and 11 deletions
|
@ -1,6 +1,20 @@
|
||||||
{ boto3, buildPythonPackage, crc32c, fetchFromGitHub, lib, matplotlib, moto
|
{ boto3
|
||||||
, numpy, pillow, pytorch, protobuf, six, pytestCheckHook
|
, buildPythonPackage
|
||||||
, tensorflow-tensorboard, torchvision }:
|
, crc32c
|
||||||
|
, fetchFromGitHub
|
||||||
|
, lib
|
||||||
|
, matplotlib
|
||||||
|
, moto
|
||||||
|
, numpy
|
||||||
|
, pillow
|
||||||
|
, protobuf
|
||||||
|
, pytestCheckHook
|
||||||
|
, pytorch
|
||||||
|
, six
|
||||||
|
, soundfile
|
||||||
|
, tensorflow-tensorboard
|
||||||
|
, torchvision
|
||||||
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "tensorboardx";
|
pname = "tensorboardx";
|
||||||
|
@ -13,19 +27,43 @@ buildPythonPackage rec {
|
||||||
sha256 = "1palz91y0b39pcmwg6wdmqfal38hai99dd6r88i3imqxdbmjghih";
|
sha256 = "1palz91y0b39pcmwg6wdmqfal38hai99dd6r88i3imqxdbmjghih";
|
||||||
};
|
};
|
||||||
|
|
||||||
checkInputs = [
|
|
||||||
pytestCheckHook boto3 crc32c matplotlib moto pillow pytorch tensorflow-tensorboard torchvision
|
|
||||||
];
|
|
||||||
|
|
||||||
propagatedBuildInputs = [ numpy protobuf six ];
|
|
||||||
|
|
||||||
# apparently torch API changed a bit at 1.6
|
# apparently torch API changed a bit at 1.6
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace tensorboardX/pytorch_graph.py --replace "torch.onnx.set_training(model, False)" "torch.onnx.select_model_mode_for_export(model, torch.onnx.TrainingMode.EVAL)"
|
substituteInPlace tensorboardX/pytorch_graph.py --replace \
|
||||||
|
"torch.onnx.set_training(model, False)" \
|
||||||
|
"torch.onnx.select_model_mode_for_export(model, torch.onnx.TrainingMode.EVAL)"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
crc32c
|
||||||
|
numpy
|
||||||
|
protobuf
|
||||||
|
six
|
||||||
|
soundfile
|
||||||
|
];
|
||||||
|
|
||||||
disabledTests = [ "test_TorchVis" "test_onnx_graph" ];
|
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"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Library for writing tensorboard-compatible logs";
|
description = "Library for writing tensorboard-compatible logs";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue