tensorflow / tensorflow/tensorboard
Hyperparameters section on tensorboard shows the old hyperparameters
@bileschi is already working on this.
Since Jun 10, 2020.
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
Description
Hello,
I am using Tensorboard HParams Dashboard. I using using the example given in the documentation.
When I change the hyperparameters, for example num_units, it is not reflected in the Hyperparameters part of the HPARAMS section. Besides, TABLE VIEW comes out empty. Before changing the hyperparameters, I make sure that I clear all the logs from the previous runs by !rm -rf ./logs/ .I kill the tensorboard instance and manually delete pid-xxxxx.info file at C:\Users\user\AppData\Local\Temp.tensorboard-info.
Apart from that my tensorboard always fails to launch at first try and gives the following error:
ERROR: Timed out waiting for TensorBoard to start. It may still be running as pid xxxxx.
Here is the output from self-diagnose;
Thanks!
I0606 17:32:07.290058 24916 <ipython-input-32-fab9feb54f6b>:150] diagnose_tensorboard.py source unavailable
### Diagnostics
<details>
<summary>Diagnostics output</summary>
--- check: autoidentify
INFO: diagnose_tensorboard.py source unavailable
I0606 17:32:07.291056 24916 :160] sys.version_info: sys.version_info(major=3, minor=7, micro=1, releaselevel='final', serial=0)
--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=7, micro=1, releaselevel='final', serial=0)
I0606 17:32:07.292052 24916 :161] os.name: nt
INFO: os.name: nt
I0606 17:32:07.294019 24916 :164] os.uname(): N/A
INFO: os.uname(): N/A
I0606 17:32:07.296037 24916 :167] sys.getwindowsversion(): sys.getwindowsversion(major=10, minor=0, build=18362, platform=2, service_pack='')
INFO: sys.getwindowsversion(): sys.getwindowsversion(major=10, minor=0, build=18362, platform=2, service_pack='')
I0606 17:32:07.297018 24916 :174] has conda-meta: True
--- check: package_management
INFO: has conda-meta: True
I0606 17:32:07.299005 24916 :175] $VIRTUAL_ENV: None
INFO: $VIRTUAL_ENV: None
--- check: installed_packages
I0606 17:32:08.400090 24916 :211] installed: tensorboard==2.1.1
INFO: installed: tensorboard==2.1.1
I0606 17:32:08.401060 24916 :211] installed: tensorflow==2.1.0
INFO: installed: tensorflow==2.1.0
I0606 17:32:08.403055 24916 :211] installed: tensorflow-estimator==2.1.0
INFO: installed: tensorflow-estimator==2.1.0
I0606 17:32:08.404052 24916 :265] tensorboard.version.VERSION: '2.1.1'
--- check: tensorboard_python_version
INFO: tensorboard.version.VERSION: '2.1.1'
I0606 17:32:08.405049 24916 :272] tensorflow.version: '2.1.0'
--- check: tensorflow_python_version
INFO: tensorflow.version: '2.1.0'
I0606 17:32:08.406047 24916 :273] tensorflow.git_version: 'v2.1.0-rc2-17-ge5bf8de410'
INFO: tensorflow.git_version: 'v2.1.0-rc2-17-ge5bf8de410'
I0606 17:32:08.539690 24916 :278] which tensorboard: b'C:\Users\user\Anaconda3\Scripts\tensorboard.exe\r\nC:\Users\user\AppData\Local\Programs\Python\Python37\Scripts\tensorboard.exe\r\n'
--- check: tensorboard_binary_path
INFO: which tensorboard: b'C:\Users\user\Anaconda3\Scripts\tensorboard.exe\r\nC:\Users\use\AppData\Local\Programs\Python\Python37\Scripts\tensorboard.exe\r\n'
I0606 17:32:08.546671 24916 :306] socket.getfqdn(): 'DESKTOP-H1EF03V'
--- 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(): 'DESKTOP-H1EF03V'
I0606 17:32:08.547698 24916 :350] directory: C:\Users\user\AppData\Local\Temp.tensorboard-info
--- check: stat_tensorboardinfo
INFO: directory: C:\Users\user\AppData\Local\Temp.tensorboard-info
I0606 17:32:08.548694 24916 :360] os.stat(...): os.stat_result(st_mode=16895, st_ino=63613344736638073, st_dev=4069055549, st_nlink=1, st_uid=0, st_gid=0, st_size=4096, st_atime=1591479099, st_mtime=1591479029, st_ctime=1590729482)
INFO: os.stat(...): os.stat_result(st_mode=16895, st_ino=63613344736638073, st_dev=4069055549, st_nlink=1, st_uid=0, st_gid=0, st_size=4096, st_atime=1591479099, st_mtime=1591479029, st_ctime=1590729482)
I0606 17:32:08.549691 24916 :361] mode: 0o40777
INFO: mode: 0o40777
I0606 17:32:08.556644 24916 :406] tensorboard_roots (1): ['C:\Users\user\Anaconda3\lib\site-packages']; bad_roots (0): []
--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['C:\Users\user\Anaconda3\lib\site-packages']; bad_roots (0): []
--- check: full_pip_freeze
I0606 17:32:09.625787 24916 :454] pip freeze --all:
absl-py==0.7.1
alabaster==0.7.12
anaconda-client==1.7.2
anaconda-navigator==1.9.6
anaconda-project==0.8.2
asn1crypto==0.24.0
astor==0.7.1
astroid==2.1.0
astropy==3.1
atomicwrites==1.2.1
attrs==18.2.0
Babel==2.6.0
backcall==0.1.0
backports.os==0.1.1
backports.shutil-get-terminal-size==1.0.0
beautifulsoup4==4.6.3
bitarray==0.8.3
bkcharts==0.2
blaze==0.11.3
bleach==3.0.2
bokeh==1.0.2
boto==2.49.0
Bottleneck==1.2.1
cachetools==4.0.0
certifi==2018.11.29
cffi==1.11.5
chardet==3.0.4
Click==7.0
cloudpickle==0.6.1
clyent==1.2.2
colorama==0.4.1
comtypes==1.1.7
conda==4.8.3
conda-build==3.17.6
conda-package-handling==1.3.11
conda-verify==3.1.1
contextlib2==0.5.5
cryptography==2.4.2
cycler==0.10.0
Cython==0.29.2
cytoolz==0.9.0.1
dask==1.0.0
datashape==0.5.4
decorator==4.3.0
defusedxml==0.5.0
distributed==1.25.1
docutils==0.14
entrypoints==0.2.3
et-xmlfile==1.0.1
fastcache==1.0.2
filelock==3.0.10
findspark==1.3.0
Flask==1.0.2
Flask-Cors==3.0.7
future==0.18.2
gast==0.2.2
gevent==1.3.7
glob2==0.6
google-auth==1.11.2
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
greenlet==0.4.15
grpcio==1.27.2
h5py==2.8.0
heapdict==1.0.0
html5lib==1.0.1
idna==2.8
imageio==2.4.1
imagesize==1.1.0
importlib-metadata==0.6
ipykernel==5.1.0
ipython==7.2.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
isort==4.3.4
itsdangerous==1.1.0
jdcal==1.4
jedi==0.13.2
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
jupyterlab==0.35.3
jupyterlab-server==0.2.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
keyring==17.0.0
kiwisolver==1.0.1
lazy-object-proxy==1.3.1
libarchive-c==2.8
llvmlite==0.26.0
locket==0.2.0
lxml==4.2.5
Markdown==3.1
MarkupSafe==1.1.0
matplotlib==3.0.2
mccabe==0.6.1
menuinst==1.4.14
mistune==0.8.4
mkl-fft==1.0.6
mkl-random==1.0.2
mock==2.0.0
more-itertools==4.3.0
mpmath==1.1.0
msgpack==0.5.6
multipledispatch==0.6.0
navigator-updater==0.2.1
nbconvert==5.4.0
nbformat==4.4.0
networkx==2.2
nltk==3.4
nose==1.3.7
notebook==5.7.4
numba==0.41.0
numexpr==2.6.8
numpy==1.16.3
numpydoc==0.8.0
oauthlib==3.1.0
odo==0.5.1
olefile==0.46
openpyxl==2.5.12
opt-einsum==3.1.0
packaging==18.0
pandas==1.0.1
pandocfilters==1.4.2
parso==0.3.1
partd==0.3.9
path.py==11.5.0
pathlib2==2.3.3
patsy==0.5.1
pbr==5.1.3
pep8==1.7.1
pickleshare==0.7.5
Pillow==5.3.0
pip==20.1.1
pkginfo==1.4.2
pluggy==0.8.0
ply==3.11
prometheus-client==0.5.0
prompt-toolkit==2.0.7
protobuf==3.11.3
psutil==5.4.8
py==1.7.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.4.0
pycosat==0.6.3
pycparser==2.19
pycrypto==2.6.1
pycurl==7.43.0.2
pyflakes==2.0.0
Pygments==2.3.1
pylint==2.2.2
pyodbc==4.0.25
pyOpenSSL==18.0.0
pyparsing==2.3.0
pyreadstat==0.2.9
PySocks==1.6.8
pytest==4.0.2
pytest-arraydiff==0.3
pytest-astropy==0.5.0
pytest-doctestplus==0.2.0
pytest-openfiles==0.3.1
pytest-remotedata==0.3.1
python-dateutil==2.7.5
pytz==2018.7
PyWavelets==1.0.1
pywin32==223
pywinpty==0.5.5
PyYAML==3.13
pyzmq==17.1.2
QtAwesome==0.5.3
qtconsole==4.4.3
QtPy==1.5.2
requests==2.21.0
requests-oauthlib==1.3.0
rope==0.11.0
rsa==4.0
ruamel-yaml==0.15.46
sas7bdat==2.2.3
scikit-image==0.14.1
scikit-learn==0.20.1
scipy==1.4.1
seaborn==0.9.0
Send2Trash==1.5.0
setuptools==47.1.1
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.12.0
snowballstemmer==1.2.1
sortedcollections==1.0.1
sortedcontainers==2.1.0
Sphinx==1.8.2
sphinxcontrib-websupport==1.1.0
spyder==3.3.2
spyder-kernels==0.3.0
SQLAlchemy==1.2.15
statsmodels==0.9.0
sympy==1.3
tables==3.4.4
tblib==1.3.2
tensorboard==2.1.1
tensorflow==2.1.0
tensorflow-estimator==2.1.0
termcolor==1.1.0
terminado==0.8.1
testpath==0.4.2
toolz==0.9.0
tornado==5.1.1
tqdm==4.28.1
traitlets==4.3.2
unicodecsv==0.14.1
urllib3==1.24.1
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
wheel==0.32.3
widgetsnbextension==3.4.2
win-inet-pton==1.0.1
win-unicode-console==0.5
wincertstore==0.2
wrapt==1.12.0
xlrd==1.2.0
XlsxWriter==1.1.2
xlwings==0.15.1
xlwt==1.3.0
zict==0.1.3
INFO: pip freeze --all:
absl-py==0.7.1
alabaster==0.7.12
anaconda-client==1.7.2
anaconda-navigator==1.9.6
anaconda-project==0.8.2
asn1crypto==0.24.0
astor==0.7.1
astroid==2.1.0
astropy==3.1
atomicwrites==1.2.1
attrs==18.2.0
Babel==2.6.0
backcall==0.1.0
backports.os==0.1.1
backports.shutil-get-terminal-size==1.0.0
beautifulsoup4==4.6.3
bitarray==0.8.3
bkcharts==0.2
blaze==0.11.3
bleach==3.0.2
bokeh==1.0.2
boto==2.49.0
Bottleneck==1.2.1
cachetools==4.0.0
certifi==2018.11.29
cffi==1.11.5
chardet==3.0.4
Click==7.0
cloudpickle==0.6.1
clyent==1.2.2
colorama==0.4.1
comtypes==1.1.7
conda==4.8.3
conda-build==3.17.6
conda-package-handling==1.3.11
conda-verify==3.1.1
contextlib2==0.5.5
cryptography==2.4.2
cycler==0.10.0
Cython==0.29.2
cytoolz==0.9.0.1
dask==1.0.0
datashape==0.5.4
decorator==4.3.0
defusedxml==0.5.0
distributed==1.25.1
docutils==0.14
entrypoints==0.2.3
et-xmlfile==1.0.1
fastcache==1.0.2
filelock==3.0.10
findspark==1.3.0
Flask==1.0.2
Flask-Cors==3.0.7
future==0.18.2
gast==0.2.2
gevent==1.3.7
glob2==0.6
google-auth==1.11.2
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
greenlet==0.4.15
grpcio==1.27.2
h5py==2.8.0
heapdict==1.0.0
html5lib==1.0.1
idna==2.8
imageio==2.4.1
imagesize==1.1.0
importlib-metadata==0.6
ipykernel==5.1.0
ipython==7.2.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
isort==4.3.4
itsdangerous==1.1.0
jdcal==1.4
jedi==0.13.2
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
jupyterlab==0.35.3
jupyterlab-server==0.2.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
keyring==17.0.0
kiwisolver==1.0.1
lazy-object-proxy==1.3.1
libarchive-c==2.8
llvmlite==0.26.0
locket==0.2.0
lxml==4.2.5
Markdown==3.1
MarkupSafe==1.1.0
matplotlib==3.0.2
mccabe==0.6.1
menuinst==1.4.14
mistune==0.8.4
mkl-fft==1.0.6
mkl-random==1.0.2
mock==2.0.0
more-itertools==4.3.0
mpmath==1.1.0
msgpack==0.5.6
multipledispatch==0.6.0
navigator-updater==0.2.1
nbconvert==5.4.0
nbformat==4.4.0
networkx==2.2
nltk==3.4
nose==1.3.7
notebook==5.7.4
numba==0.41.0
numexpr==2.6.8
numpy==1.16.3
numpydoc==0.8.0
oauthlib==3.1.0
odo==0.5.1
olefile==0.46
openpyxl==2.5.12
opt-einsum==3.1.0
packaging==18.0
pandas==1.0.1
pandocfilters==1.4.2
parso==0.3.1
partd==0.3.9
path.py==11.5.0
pathlib2==2.3.3
patsy==0.5.1
pbr==5.1.3
pep8==1.7.1
pickleshare==0.7.5
Pillow==5.3.0
pip==20.1.1
pkginfo==1.4.2
pluggy==0.8.0
ply==3.11
prometheus-client==0.5.0
prompt-toolkit==2.0.7
protobuf==3.11.3
psutil==5.4.8
py==1.7.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.4.0
pycosat==0.6.3
pycparser==2.19
pycrypto==2.6.1
pycurl==7.43.0.2
pyflakes==2.0.0
Pygments==2.3.1
pylint==2.2.2
pyodbc==4.0.25
pyOpenSSL==18.0.0
pyparsing==2.3.0
pyreadstat==0.2.9
PySocks==1.6.8
pytest==4.0.2
pytest-arraydiff==0.3
pytest-astropy==0.5.0
pytest-doctestplus==0.2.0
pytest-openfiles==0.3.1
pytest-remotedata==0.3.1
python-dateutil==2.7.5
pytz==2018.7
PyWavelets==1.0.1
pywin32==223
pywinpty==0.5.5
PyYAML==3.13
pyzmq==17.1.2
QtAwesome==0.5.3
qtconsole==4.4.3
QtPy==1.5.2
requests==2.21.0
requests-oauthlib==1.3.0
rope==0.11.0
rsa==4.0
ruamel-yaml==0.15.46
sas7bdat==2.2.3
scikit-image==0.14.1
scikit-learn==0.20.1
scipy==1.4.1
seaborn==0.9.0
Send2Trash==1.5.0
setuptools==47.1.1
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.12.0
snowballstemmer==1.2.1
sortedcollections==1.0.1
sortedcontainers==2.1.0
Sphinx==1.8.2
sphinxcontrib-websupport==1.1.0
spyder==3.3.2
spyder-kernels==0.3.0
SQLAlchemy==1.2.15
statsmodels==0.9.0
sympy==1.3
tables==3.4.4
tblib==1.3.2
tensorboard==2.1.1
tensorflow==2.1.0
tensorflow-estimator==2.1.0
termcolor==1.1.0
terminado==0.8.1
testpath==0.4.2
toolz==0.9.0
tornado==5.1.1
tqdm==4.28.1
traitlets==4.3.2
unicodecsv==0.14.1
urllib3==1.24.1
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
wheel==0.32.3
widgetsnbextension==3.4.2
win-inet-pton==1.0.1
win-unicode-console==0.5
wincertstore==0.2
wrapt==1.12.0
xlrd==1.2.0
XlsxWriter==1.1.2
xlwings==0.15.1
xlwt==1.3.0
zict==0.1.3
</details>
### 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.
```
## Steps to reproduce (required)
Please provide explicit commands to reproduce the problem in a fresh
environment (virtualenv, Conda environment, …). Include any necessary
configuration, such as Conda `environment.yml` files.
```
%load_ext tensorboard
!rm -rf ./logs/
import tensorflow as tf
from tensorboard.plugins.hparams import api as hp
fashion_mnist = tf.keras.datasets.fashion_mnist
(x_train, y_train),(x_test, y_test) = fashion_mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
HP_NUM_UNITS = hp.HParam('num_units', hp.Discrete([8, 16]))
HP_DROPOUT = hp.HParam('dropout', hp.RealInterval(0.1, 0.2))
HP_OPTIMIZER = hp.HParam('optimizer', hp.Discrete(['adam', 'sgd']))
METRIC_ACCURACY = 'accuracy'
with tf.summary.create_file_writer('logs/hparam_tuning').as_default():
hp.hparams_config(
hparams=[HP_NUM_UNITS, HP_DROPOUT, HP_OPTIMIZER],
metrics=[hp.Metric(METRIC_ACCURACY, display_name='Accuracy')],
)
def train_test_model(hparams):
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(hparams[HP_NUM_UNITS], activation=tf.nn.relu),
tf.keras.layers.Dropout(hparams[HP_DROPOUT]),
tf.keras.layers.Dense(10, activation=tf.nn.softmax),
])
model.compile(
optimizer=hparams[HP_OPTIMIZER],
loss='sparse_categorical_crossentropy',
metrics=['accuracy'],
)
model.fit(x_train, y_train, epochs=1) # Run with 1 epoch to speed things up for demo purposes
_, accuracy = model.evaluate(x_test, y_test)
return accuracy
def run(run_dir, hparams):
with tf.summary.create_file_writer(run_dir).as_default():
hp.hparams(hparams) # record the values used in this trial
accuracy = train_test_model(hparams)
tf.summary.scalar(METRIC_ACCURACY, accuracy, step=1)
session_num = 0
for num_units in HP_NUM_UNITS.domain.values:
for dropout_rate in (HP_DROPOUT.domain.min_value, HP_DROPOUT.domain.max_value):
for optimizer in HP_OPTIMIZER.domain.values:
hparams = {
HP_NUM_UNITS: num_units,
HP_DROPOUT: dropout_rate,
HP_OPTIMIZER: optimizer,
}
run_name = "run-%d" % session_num
print('--- Starting trial: %s' % run_name)
print({h.name: hparams[h] for h in hparams})
run('logs/hparam_tuning/' + run_name, hparams)
session_num += 1
!kill 20136
%tensorboard --logdir logs/hparam_tuning
```
The output shows hyperparameters from previous models.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.