Commit Graph

65 Commits

Author SHA1 Message Date
Pieter Noordhuis
32b7b8994f Delay external imports until we're ready to test tensorboard (#25993)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25993

These imports fail the test suite if they're not installed, even if we
don't end up testing tensorboard.

[test macos]

Test Plan: Imported from OSS

Differential Revision: D17318588

Pulled By: pietern

fbshipit-source-id: febad497ecb3fd292317f68fc2439acd893ccd67
2019-09-11 13:55:58 -07:00
Tzu-Wei Huang
cd14518ee8 hyperparameter plugin (#23134)
Summary:
closes https://github.com/pytorch/pytorch/issues/16838

example usage:
```python
writer.add_hparam(hparam_dict= {'lr': 0.1, 'bsize': 12}, metrics= {'accuracy': 0.987, 'loss': 10})

```
cc orionr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23134

Reviewed By: orionr

Differential Revision: D16807300

Pulled By: sanekmelnikov

fbshipit-source-id: 4072c529076f423b34b00b68be2d6eec444423fe
2019-08-26 10:40:34 -07:00
Alexander Melnikov
d7b86d0c11 added test_tensorboard.py to TARGETS (#24040)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/24040

This diff fixes failed test in test_tensorboard.py:
  - fixed test_image_with_boxes: tests compares serialized protobuf Summary object with image against expected serialized protobuf in file. Turns out that comparing images string by string might not work (e.g. if they were serialized with different versions of image library) - images can be equal, though due to differences in metadata or compression methods actual strings might differ. Changed to compare images using == from PIL.Image

Reviewed By: orionr

Differential Revision: D16715831

fbshipit-source-id: 7dd4a7cfc8e63767ed727656f1891edd273d95da
2019-08-16 09:44:00 -07:00
Alexander Melnikov
5d47d85392 added mesh plugin (#24039)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/24039

This diff adds mesh plugin:
- added tests to test_tensorboard.py
- fixed an error occured after updating tensorboard to the latest version (added "components" argument to create_summary_metadata): 5e5badc666 (diff-068400aa3e34121b7256539582374597)

Reviewed By: orionr

Differential Revision: D16714759

fbshipit-source-id: df349541a058fa90310d1815160e29d20c6ef065
2019-08-09 10:22:43 -07:00
Orion Reblitz-Richardson
858d4a6a04 Cleanup API and remove 'experimental' warning (#23000)
Summary:
This fixes ASAN test issues with https://github.com/pytorch/pytorch/pull/21786 seen at https://circleci.com/api/v1.1/project/github/pytorch/pytorch/2212325/output/105/0?file=true and lands it again.

This cleans up the `torch.utils.tensorboard` API to remove all kwargs usage (which isn't clear to the  user) and removes the "experimental" warning in prep for our 1.2 release.

We also don't need the additional PyTorch version checks now that we are in the codebase itself.

cc yf225, lanpa, natalialunova
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23000

Reviewed By: sanekmelnikov

Differential Revision: D16349734

Pulled By: orionr

fbshipit-source-id: 604a9cad56868a55e08b509a0c6f42b84f68de95
2019-07-22 12:10:05 -07:00
Orion Reblitz-Richardson
e24f18cea0 Revert D15854892: [pytorch][PR] [tensorboard] Cleanup API and remove 'experimental' warning
Differential Revision:
D15854892

Original commit changeset: 06b849882694

fbshipit-source-id: 588edc4616d020a23645f8c8181782c8412c4c6e
2019-07-17 16:45:54 -07:00
Orion Reblitz-Richardson
4861527446 Cleanup API and remove 'experimental' warning (#21786)
Summary:
This cleans up the `torch.utils.tensorboard` API to remove all kwargs usage (which isn't clear to the  user) and removes the "experimental" warning in prep for our 1.2 release.

We also don't need the additional PyTorch version checks now that we are in the codebase itself.

cc ezyang lanpa natalialunova
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21786

Reviewed By: natalialunova

Differential Revision: D15854892

Pulled By: orionr

fbshipit-source-id: 06b8498826946e578824d4b15c910edb3c2c20c6
2019-07-17 10:34:00 -07:00
Tzu-Wei Huang
1fc240e59a add tests for add_custom_scalars and others (#20987)
Summary:
Originally, the tests for tensorboard writer are smoke tests only. This PR lets CI compare the output with expected results at low level. The randomness of the tensors in the test are also removed.
ps. I found that how protobuf serializes data differs between different python environment. One method to solve this is to write the data and then read it back instantly. (compare the data at a higher level)

For `add_custom_scalars`, the data to be written is a dictionary. and the serialized result might be different (not `ordereddict`). So only smoke test for that.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20987

Reviewed By: NarineK, lanpa

Differential Revision: D15804871

Pulled By: orionr

fbshipit-source-id: 69324c11ff823b19960d50def73adff36eb4a2ac
2019-06-14 12:27:07 -07:00
Tzu-Wei Huang
54413cf91e replace LegacyTracedModule with torchscript used in add_graph (#21339)
Summary:
The new implementation of tracing supports more module. So many error-handling code can be removed by placing the old one (LegacyTracedModule).

cc orionr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21339

Reviewed By: natalialunova

Differential Revision: D15695154

Pulled By: orionr

fbshipit-source-id: af7d35754e9f34bd1a0ad7b72a9ebe276ff8ab98
2019-06-07 10:43:08 -07:00
Tzu-Wei Huang
cfc98ae714 fix add_histogram_raw (#20688)
Summary:
This is a porting of the fix from:
https://github.com/lanpa/tensorboardX/issues/421

cc orionr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20688

Reviewed By: NarineK

Differential Revision: D15415093

Pulled By: orionr

fbshipit-source-id: d32a6298218fbc6fe315aa0f18b57e0c8ef92627
2019-05-22 14:06:21 -07:00
Tzu-Wei Huang
6dc70aa513 add test coverage for make_np (#20317)
Summary:
addresses https://github.com/pytorch/pytorch/pull/16196#discussion_r276381946

cc orionr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20317

Differential Revision: D15289400

Pulled By: orionr

fbshipit-source-id: 914416a8c1369d95656f556c6e05348957789466
2019-05-10 13:59:48 -07:00
Tzu-Wei Huang
fb9d9fbd4e smoke test for add_graph (#20007)
Summary:
Do tests with common models from torchvision.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20007

Differential Revision: D15251754

Pulled By: orionr

fbshipit-source-id: 9dc09bd407b3ccaaa310d2f4a8d53d5a7d12469d
2019-05-07 18:29:25 -07:00
Orion Reblitz-Richardson
0c5dc965a4 Add logging import and failing MLP (#20115)
Summary:
Add logging import and a failed MLP model that confirms that we don't fail `add_graph` when graph optimization fails.

This addresses part of https://github.com/pytorch/pytorch/issues/18903

cc lanpa ezyang natalialunova
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20115

Reviewed By: natalialunova

Differential Revision: D15206765

Pulled By: orionr

fbshipit-source-id: c40b7e2671ef845a1529a2910ba030159f53f393
2019-05-06 15:44:59 -07:00
Orion Reblitz-Richardson
af87cfd7f9 Remove in-memory scalars and add comments (#20038)
Summary:
This takes care of some outstanding review comments for https://github.com/pytorch/pytorch/pull/16196/

Specifically:
1. Add comment about kind
2. Add comment about GraphPy
3. Remove ONNX version comment
4. Remove scalar_dict from SummaryWriter and all history functions

cc lanpa ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20038

Reviewed By: natalialunova

Differential Revision: D15177257

Pulled By: orionr

fbshipit-source-id: 218aa799d8b7dbb58f422a331236bba4959347de
2019-05-02 22:26:28 -07:00
Tzu-Wei Huang
98e312cf96 TensorBoard support within PyTorch (#16196)
Summary:
This PR adds TensorBoard logging support natively within PyTorch. It is based on the tensorboardX  code developed by lanpa and relies on changes inside the tensorflow/tensorboard repo landing at https://github.com/tensorflow/tensorboard/pull/2065.

With  these changes users can simply `pip install tensorboard; pip install torch` and then log PyTorch data directly to the TensorBoard protobuf format using

```
import torch
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter()
s1 = torch.rand(1)
writer.add_scalar('data/scalar1', s1[0], 0)
writer.close()
```

Design:
- `EventFileWriter` and `RecordWriter` from tensorboardX now live in tensorflow/tensorboard
- `SummaryWriter` and PyTorch-specific conversion from tensors, nn modules, etc. now live in pytorch/pytorch. We also support Caffe2 blobs and nets.

Action items:
- [x] `from torch.utils.tensorboard import SummaryWriter`
- [x] rename functions
- [x] unittests
- [x] move actual writing function to tensorflow/tensorboard in https://github.com/tensorflow/tensorboard/pull/2065

Review:
- Please review for PyTorch standard formatting, code usage, etc.
- Please verify unittest usage is correct and executing in CI

Any significant changes made here will likely be synced back to github.com/lanpa/tensorboardX/ in the future.

cc orionr, ezyang
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16196

Differential Revision: D15062901

Pulled By: orionr

fbshipit-source-id: 3812eb6aa07a2811979c5c7b70810261f9ea169e
2019-04-25 21:30:23 -07:00