Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.tensorboardx: fix build after upgrade to PyTorch 1.6 #97261

Merged
merged 1 commit into from Nov 11, 2020

Conversation

akamaus
Copy link
Contributor

@akamaus akamaus commented Sep 5, 2020

Motivation for this change

Torch ONNX api changed a bit in 1.6 version. TensorboardX build fails now.

Things done

Tweaked code a bit so test works again.

  • Built on platform(s)
    • [X ] NixOS
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@akamaus akamaus force-pushed the tensorboardx-pytorch1.6-repair branch from 4d293eb to 9ff9e3a Compare November 10, 2020 16:46
@akamaus
Copy link
Contributor Author

akamaus commented Nov 10, 2020

2 months passed and we still have broken tensorboardX in master.

@danieldk danieldk force-pushed the tensorboardx-pytorch1.6-repair branch from 9ff9e3a to 16273d2 Compare November 10, 2020 18:10
@danieldk danieldk changed the title tensorboardx: repaired build (was broken because of bumping pytorch to 1.6 python3Packages.tensorboardx: fix build after upgrade to PyTorch 1.6 Nov 10, 2020
Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM

https://github.com/NixOS/nixpkgs/pull/97261
2 packages built:
python37Packages.tensorboardx python38Packages.tensorboardx

Comment on lines +23 to +25
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)"
'';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for readability

Suggested change
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)"
'';
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)"
'';

@jonringer
Copy link
Contributor

does bumping this to 2.1 fix this?

https://github.com/lanpa/tensorboardX/releases/tag/v2.1

@danieldk
Copy link
Contributor

does bumping this to 2.1 fix this?

https://github.com/lanpa/tensorboardX/releases/tag/v2.1

See

#97261 (comment)

@danieldk danieldk force-pushed the tensorboardx-pytorch1.6-repair branch from 16273d2 to 0223525 Compare November 11, 2020 05:50
@danieldk
Copy link
Contributor

@ofborg build python37Packages.tensorboardx python38Packages.tensorboardx

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Result of nixpkgs-review pr 97261 1

2 packages built:
  • python37Packages.tensorboardx
  • python38Packages.tensorboardx

@jonringer jonringer merged commit 9b9cf94 into NixOS:master Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants