tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

misleading "No hparams data was found" error when metrics are not defined

Open francois-rozet opened this issue 3 years ago • 3 comments

Environment information (required)

Diagnostics

Diagnostics output
--- check: autoidentify
INFO: diagnose_tensorboard.py version e43767ef2b648d0d5d57c00f38ccbd38390e38da

--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=9, micro=7, releaselevel='final', serial=0)
INFO: os.name: nt
INFO: os.uname(): N/A
INFO: sys.getwindowsversion(): sys.getwindowsversion(major=10, minor=0, build=22000, platform=2, service_pack='')

--- check: package_management
INFO: has conda-meta: True
INFO: $VIRTUAL_ENV: None

--- check: installed_packages
INFO: installed: tensorboard==2.7.0
WARNING: no installation among: ['tensorflow', 'tensorflow-gpu', 'tf-nightly', 'tf-nightly-2.0-preview', 'tf-nightly-gpu', 'tf-nightly-gpu-2.0-preview']
WARNING: no installation among: ['tensorflow-estimator', 'tensorflow-estimator-2.0-preview', 'tf-estimator-nightly']
INFO: installed: tensorboard-data-server==0.6.1

--- check: tensorboard_python_version
INFO: tensorboard.version.VERSION: '2.7.0'

--- check: tensorflow_python_version
Traceback (most recent call last):
  File "C:\Users\franc\Documents\Git\lampe\diagnose_tensorboard.py", line 522, in main
    suggestions.extend(check())
  File "C:\Users\franc\Documents\Git\lampe\diagnose_tensorboard.py", line 75, in wrapper
    result = fn()
  File "C:\Users\franc\Documents\Git\lampe\diagnose_tensorboard.py", line 278, in tensorflow_python_version
    import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'

--- check: tensorboard_data_server_version
INFO: data server binary: None

--- check: tensorboard_binary_path
INFO: which tensorboard: b'C:\\Users\\franc\\miniconda3\\envs\\lampe\\Scripts\\tensorboard.exe\r\n'

--- check: addrinfos
socket.has_ipv6 = True
socket.AF_UNSPEC = <AddressFamily.AF_UNSPEC: 0>
socket.SOCK_STREAM = <SocketKind.SOCK_STREAM: 1>
socket.AI_ADDRCONFIG = <AddressInfo.AI_ADDRCONFIG: 1024>
socket.AI_PASSIVE = <AddressInfo.AI_PASSIVE: 1>
Loopback flags: <AddressInfo.AI_ADDRCONFIG: 1024>
Loopback infos: [(<AddressFamily.AF_INET6: 23>, <SocketKind.SOCK_STREAM: 1>, 0, '', ('::1', 0, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 0, '', ('127.0.0.1', 0))]
Wildcard flags: <AddressInfo.AI_PASSIVE: 1>
Wildcard infos: [(<AddressFamily.AF_INET6: 23>, <SocketKind.SOCK_STREAM: 1>, 0, '', ('::', 0, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 0, '', ('0.0.0.0', 0))]

--- check: readable_fqdn
INFO: socket.getfqdn(): 'LEGION-T5.voo.be'

--- check: stat_tensorboardinfo
INFO: directory: C:\Users\franc\AppData\Local\Temp\.tensorboard-info
INFO: os.stat(...): os.stat_result(st_mode=16895, st_ino=24769797950540946, st_dev=344357538, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1640165536, st_mtime=1640165536, st_ctime=1640130332)
INFO: mode: 0o40777

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['C:\\Users\\franc\\miniconda3\\envs\\lampe\\lib\\site-packages']; bad_roots (0): []

--- check: full_pip_freeze
INFO: pip freeze --all:
absl-py==1.0.0

anyio @ file:///D:/bld/anyio_1637705443769/work/dist

argon2-cffi @ file:///D:/bld/argon2-cffi_1636021473347/work

async-generator==1.10

attrs @ file:///home/conda/feedstock_root/build_artifacts/attrs_1620387926260/work

Babel @ file:///home/conda/feedstock_root/build_artifacts/babel_1619719576210/work

backcall @ file:///home/conda/feedstock_root/build_artifacts/backcall_1592338393461/work

backports.functools-lru-cache @ file:///home/conda/feedstock_root/build_artifacts/backports.functools_lru_cache_1618230623929/work

bleach @ file:///home/conda/feedstock_root/build_artifacts/bleach_1629908509068/work

brotlipy @ file:///D:/bld/brotlipy_1636012392748/work

cached-property @ file:///home/conda/feedstock_root/build_artifacts/cached_property_1615209429212/work

cachetools==4.2.4

certifi==2021.10.8

cffi @ file:///D:/bld/cffi_1636046278333/work

charset-normalizer @ file:///home/conda/feedstock_root/build_artifacts/charset-normalizer_1638815705608/work

colorama @ file:///home/conda/feedstock_root/build_artifacts/colorama_1602866480661/work

corner==2.2.1

cryptography @ file:///D:/bld/cryptography_1639699435873/work

cycler==0.11.0

debugpy @ file:///D:/bld/debugpy_1636043436560/work

decorator @ file:///home/conda/feedstock_root/build_artifacts/decorator_1631346842025/work

defusedxml @ file:///home/conda/feedstock_root/build_artifacts/defusedxml_1615232257335/work

entrypoints @ file:///home/conda/feedstock_root/build_artifacts/entrypoints_1605121927639/work/dist/entrypoints-0.3-py2.py3-none-any.whl

fonttools==4.28.5

google-auth==2.3.3

google-auth-oauthlib==0.4.6

grpcio==1.43.0

h5py @ file:///D:/bld/h5py_1637964127763/work

idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1609836280497/work

importlib-metadata @ file:///D:/bld/importlib-metadata_1639976361370/work

importlib-resources @ file:///home/conda/feedstock_root/build_artifacts/importlib_resources_1635615662634/work

ipykernel @ file:///D:/bld/ipykernel_1638555715117/work/dist/ipykernel-6.6.0-py3-none-any.whl

ipython @ file:///D:/bld/ipython_1638470606441/work

ipython-genutils==0.2.0

jedi @ file:///D:/bld/jedi_1637175252639/work

Jinja2 @ file:///home/conda/feedstock_root/build_artifacts/jinja2_1636510082894/work

json5 @ file:///home/conda/feedstock_root/build_artifacts/json5_1600692310011/work

jsonschema @ file:///home/conda/feedstock_root/build_artifacts/jsonschema-meta_1640026479618/work

jupyter-client @ file:///home/conda/feedstock_root/build_artifacts/jupyter_client_1637611911738/work

jupyter-core @ file:///D:/bld/jupyter_core_1636814453100/work

jupyter-server @ file:///home/conda/feedstock_root/build_artifacts/jupyter_server_1639084645710/work

jupyterlab @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_1639150690547/work

jupyterlab-pygments @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_pygments_1601375948261/work

jupyterlab-server @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_server_1639404907821/work

kiwisolver==1.3.2

Markdown==3.3.6

MarkupSafe @ file:///D:/bld/markupsafe_1635833710307/work

matplotlib==3.5.1

matplotlib-inline @ file:///home/conda/feedstock_root/build_artifacts/matplotlib-inline_1631080358261/work

mistune @ file:///D:/bld/mistune_1635844891406/work

mkl-fft==1.3.1

mkl-random==1.2.2

mkl-service==2.4.0

nbclassic @ file:///home/conda/feedstock_root/build_artifacts/nbclassic_1635436909771/work

nbclient @ file:///home/conda/feedstock_root/build_artifacts/nbclient_1637327213451/work

nbconvert @ file:///D:/bld/nbconvert_1636897398749/work

nbformat @ file:///home/conda/feedstock_root/build_artifacts/nbformat_1617383142101/work

nest-asyncio @ file:///home/conda/feedstock_root/build_artifacts/nest-asyncio_1638419302549/work

notebook @ file:///home/conda/feedstock_root/build_artifacts/notebook_1637122013008/work

numpy @ file:///C:/ci/numpy_and_numpy_base_1634088717532/work

oauthlib==3.1.1

opt-einsum @ file:///home/conda/feedstock_root/build_artifacts/opt_einsum_1617859230218/work

packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1637239678211/work

pandocfilters @ file:///home/conda/feedstock_root/build_artifacts/pandocfilters_1631603243851/work

parso @ file:///home/conda/feedstock_root/build_artifacts/parso_1638334955874/work

pickleshare @ file:///home/conda/feedstock_root/build_artifacts/pickleshare_1602536217715/work

Pillow==8.4.0

pip==21.2.4

prometheus-client @ file:///home/conda/feedstock_root/build_artifacts/prometheus_client_1635538335951/work

prompt-toolkit @ file:///home/conda/feedstock_root/build_artifacts/prompt-toolkit_1639065841292/work

protobuf==3.19.1

pyasn1==0.4.8

pyasn1-modules==0.2.8

pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1636257122734/work

Pygments @ file:///home/conda/feedstock_root/build_artifacts/pygments_1629119114968/work

pyOpenSSL @ file:///home/conda/feedstock_root/build_artifacts/pyopenssl_1633192417276/work

pyparsing @ file:///home/conda/feedstock_root/build_artifacts/pyparsing_1636757021002/work

pyro-api @ file:///home/conda/feedstock_root/build_artifacts/pyro-api_1614940619870/work

pyro-ppl @ file:///home/conda/feedstock_root/build_artifacts/pyro-ppl_1639509033331/work

pyrsistent @ file:///D:/bld/pyrsistent_1636052888715/work

PySocks @ file:///D:/bld/pysocks_1635862562854/work

python-dateutil @ file:///home/conda/feedstock_root/build_artifacts/python-dateutil_1626286286081/work

pytz @ file:///home/conda/feedstock_root/build_artifacts/pytz_1633452062248/work

pywin32==302

pywinpty @ file:///C:/ci/pywinpty_1607419945780/work

pyzmq @ file:///D:/bld/pyzmq_1635877415276/work

requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1637771257551/work

requests-oauthlib==1.3.0

rsa==4.8

Send2Trash @ file:///home/conda/feedstock_root/build_artifacts/send2trash_1628511208346/work

setuptools==58.0.4

six @ file:///home/conda/feedstock_root/build_artifacts/six_1620240208055/work

sniffio @ file:///D:/bld/sniffio_1635844947979/work

tensorboard==2.7.0

tensorboard-data-server==0.6.1

tensorboard-plugin-wit==1.8.0

terminado==0.9.4

testpath @ file:///home/conda/feedstock_root/build_artifacts/testpath_1621261527237/work

torch==1.10.1

tornado @ file:///D:/bld/tornado_1635819745510/work

tqdm @ file:///home/conda/feedstock_root/build_artifacts/tqdm_1632160078689/work

traitlets @ file:///home/conda/feedstock_root/build_artifacts/traitlets_1635260543454/work

typing-extensions @ file:///tmp/build/80754af9/typing_extensions_1631814937681/work

urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1632350318291/work

wcwidth @ file:///home/conda/feedstock_root/build_artifacts/wcwidth_1600965781394/work

webencodings==0.5.1

websocket-client @ file:///home/conda/feedstock_root/build_artifacts/websocket-client_1638949723239/work

Werkzeug==2.0.2

wheel==0.37.0

win-inet-pton @ file:///D:/bld/win_inet_pton_1635832858406/work

wincertstore==0.2

zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1633302054558/work


Next steps

No action items identified. Please copy ALL of the above output, including the lines containing only backticks, into your GitHub issue or comment. Be sure to redact any sensitive information.

Browser: Brave Version 1.33.106 Chromium: 96.0.4664.110 (Official Build) (64-bit)

Issue description

I am trying to log hyper parameters with the PyTorch tensorboard interface. The event files are registered correctly in the logdir but when I launch tensorboard they are not "found". For instance,

from torch.utils.tensorboard import SummaryWriter

writer = SummaryWriter(log_dir='test/hparams')

for i in range(5):
    writer.add_hparams({
        'a': i * 1,
        'b': i * 2,
        'c': i * 3,
    }, {})

leads to

image

The weird part is that tensorboard actually finds the hyper parameters since it

  1. displays the hyper parameter names correctly (in this case a, b and c)
  2. allows to export the rows as a CSV/JSON with the correct data
a,b,c
0.0,0.0,0.0
1.0,2.0,3.0
2.0,4.0,6.0
3.0,6.0,9.0
4.0,8.0,12.0

francois-rozet avatar Dec 22 '21 09:12 francois-rozet

The HParams dashboard currently requires at least one hparam and at least one metric defined in the hparams configuration:

https://github.com/tensorflow/tensorboard/blob/70bf1552dc2236e2dfacaed40a360adfecd1e5de/tensorboard/plugins/hparams/tf_hparams_query_pane/tf-hparams-query-pane.ts#L545-L555

If that's not the case - in particular, if you only have hparams logged, but no metrics - it will show the "No hparams data was found" error page. I agree this is somewhat misleading here, and we should probably either adjust the error message to explain this, or should relax the constraint so it still shows up even if there aren't any metrics (since we could at least show the hyperparameter combinations).

nfelt avatar Dec 22 '21 23:12 nfelt

Thank you for the quick answer! IMHO, I don't see why this constraint exists in the first place. The board should show up if there are hparams or metrics, not and.

francois-rozet avatar Dec 23 '21 07:12 francois-rozet

+1 this is still an issue!

JayCarraway avatar Apr 04 '23 08:04 JayCarraway