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

Tensorboard 2.7 seems to be broken on Safari #5489

Closed
severo opened this issue Jan 7, 2022 · 11 comments
Closed

Tensorboard 2.7 seems to be broken on Safari #5489

severo opened this issue Jan 7, 2022 · 11 comments

Comments

@severo
Copy link

severo commented Jan 7, 2022

Environment information (required)

Please run diagnose_tensorboard.py (link below) in the same
environment from which you normally run TensorFlow/TensorBoard, and
paste the output here:

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

--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=8, micro=11, releaselevel='final', serial=0)
INFO: os.name: posix
INFO: os.uname(): posix.uname_result(sysname='Linux', nodename='aws-dev-sylvain-lesage.local', release='5.11.0-1023-aws', version='#24~20.04.1-Ubuntu SMP Fri Dec 3 13:46:41 UTC 2021', machine='x86_64')
INFO: sys.getwindowsversion(): N/A

--- check: package_management
INFO: has conda-meta: False
INFO: $VIRTUAL_ENV: '/tmp/test/.venv'

--- check: installed_packages
WARNING: no installation among: ['tb-nightly', 'tensorboard', 'tensorflow-tensorboard']
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']

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

--- check: tensorflow_python_version
Traceback (most recent call last):
  File "diagnose_tensorboard.py", line 522, in main
    suggestions.extend(check())
  File "diagnose_tensorboard.py", line 75, in wrapper
    result = fn()
  File "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: '/tmp/test/.venv/lib/python3.8/site-packages/tensorboard_data_server/bin/server'
INFO: data server binary version: b'rustboard 0.6.1'

--- check: tensorboard_binary_path
INFO: which tensorboard: b'/tmp/test/.venv/bin/tensorboard\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: 32>
socket.AI_PASSIVE = <AddressInfo.AI_PASSIVE: 1>
Loopback flags: <AddressInfo.AI_ADDRCONFIG: 32>
Loopback infos: [(<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::1', 0, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 0))]
Wildcard flags: <AddressInfo.AI_PASSIVE: 1>
Wildcard infos: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('0.0.0.0', 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::', 0, 0, 0))]

--- check: readable_fqdn
INFO: socket.getfqdn(): 'aws-dev-sylvain-lesage.local'

--- check: stat_tensorboardinfo
INFO: directory: /tmp/.tensorboard-info
INFO: os.stat(...): os.stat_result(st_mode=16895, st_ino=160438, st_dev=66305, st_nlink=2, st_uid=1002, st_gid=1002, st_size=4096, st_atime=1641572304, st_mtime=1641572971, st_ctime=1641572971)
INFO: mode: 0o40777

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['/tmp/test/.venv/lib/python3.8/site-packages']; bad_roots (0): []

--- check: full_pip_freeze
INFO: pip freeze --all:
absl-py @ file:///home/slesage/.cache/pypoetry/artifacts/fd/85/ab/c9a668cd72167af3d70bc17c234f5b70290267879d2408863d47df050e/absl_py-1.0.0-py3-none-any.whl
cachetools @ file:///home/slesage/.cache/pypoetry/artifacts/ca/68/fb/a94522dd8c8d081803f16d6ec74ce9a678a827247431e2a8339f25506f/cachetools-4.2.4-py3-none-any.whl
certifi @ file:///home/slesage/.cache/pypoetry/artifacts/77/74/3e/daf57610ff13227e3b3f50a78487055f6ac94cc9363abd2463be34c5e9/certifi-2021.10.8-py2.py3-none-any.whl
charset-normalizer @ file:///home/slesage/.cache/pypoetry/artifacts/29/08/0b/18a5b01605aa22aab30518fc8cb6c0777890b2b9b842f7a691b70ec4a7/charset_normalizer-2.0.10-py3-none-any.whl
google-auth @ file:///home/slesage/.cache/pypoetry/artifacts/18/e0/0d/4c23cb7ad50e9df8ad4f7c1d3a4a604f77e353ec37a3c36fc7b5ae6fe7/google_auth-2.3.3-py2.py3-none-any.whl
google-auth-oauthlib @ file:///home/slesage/.cache/pypoetry/artifacts/35/f1/0a/8a2ac196dbf26e110b0c838bbbaeb3707a1475bae0e456bdf49b0dbb7b/google_auth_oauthlib-0.4.6-py2.py3-none-any.whl
grpcio @ file:///home/slesage/.cache/pypoetry/artifacts/b2/d8/e9/f48b964c0a51a3401c2028f74d72bd1d41e963c5245e9cc8ab7049dd21/grpcio-1.43.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
idna @ file:///home/slesage/.cache/pypoetry/artifacts/f7/09/c9/8e80952436ff87855ddff4891a35ecf913b2b5dc97911f02a070ff2b1f/idna-3.3-py3-none-any.whl
importlib-metadata @ file:///home/slesage/.cache/pypoetry/artifacts/e2/c9/6a/44457c44f5a0f97bcdf54be8e6dd51167474a5dfeba100dcd468d90229/importlib_metadata-4.10.0-py3-none-any.whl
Markdown @ file:///home/slesage/.cache/pypoetry/artifacts/50/34/0c/89a9ef9d0d40b883e6bb72dd502a1c818253a7a15b23f3f47c07cca2d9/Markdown-3.3.6-py3-none-any.whl
numpy @ file:///home/slesage/.cache/pypoetry/artifacts/c1/93/6b/73bffcc2854fe42c67425f57b5fbb014c57d3acdea12897e56dd399bab/numpy-1.22.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
oauthlib @ file:///home/slesage/.cache/pypoetry/artifacts/e6/64/ef/a43b939f04c9ee17174fb3657dba149ed15ba473ef44adf939f5032b85/oauthlib-3.1.1-py2.py3-none-any.whl
pip==21.3.1
protobuf @ file:///home/slesage/.cache/pypoetry/artifacts/c1/90/af/e9aa3788bc7a9d959573c60f1a0a7358ccb00e7daa7751494b80be7a48/protobuf-3.19.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyasn1 @ file:///home/slesage/.cache/pypoetry/artifacts/a6/f7/5e/59a43ec23ade0888631b3f24244da7f5d5a0b6b40849c86b8c6b4c54d1/pyasn1-0.4.8-py2.py3-none-any.whl
pyasn1-modules @ file:///home/slesage/.cache/pypoetry/artifacts/09/f6/56/0e33158234b3e9b9e5d8eb01e7a96670a99ab43b3dbe89b0f129477a59/pyasn1_modules-0.2.8-py2.py3-none-any.whl
requests @ file:///home/slesage/.cache/pypoetry/artifacts/dc/17/bf/8d9779110a13421f6181028974b24800ec70f28bf9b311411e1868b8c7/requests-2.27.1-py2.py3-none-any.whl
requests-oauthlib @ file:///home/slesage/.cache/pypoetry/artifacts/93/9e/43/0dbe21742ed37c1ceeb4f2533e99279ab723f0982020584d6133946ad5/requests_oauthlib-1.3.0-py2.py3-none-any.whl
rsa @ file:///home/slesage/.cache/pypoetry/artifacts/73/0a/c4/2ebf484214eb26f696c3bd14ac3b561ac093bd9aff1692645bd5f73ca7/rsa-4.8-py3-none-any.whl
setuptools==59.5.0
six @ file:///home/slesage/.cache/pypoetry/artifacts/48/e6/04/8118155ae3ec3a16dd2a213bbf7a7d8a62c596b2e90f73a22c896269f1/six-1.16.0-py2.py3-none-any.whl
tensorboard @ file:///home/slesage/.cache/pypoetry/artifacts/84/35/f7/14f685583f22ba5b25d64eb7176e45fb4d0e4be7ac8375d50ab5e938a4/tensorboard-2.7.0-py3-none-any.whl
tensorboard-data-server @ file:///home/slesage/.cache/pypoetry/artifacts/00/59/84/14d222b8b99200f32c951408eb2916f733292916b0f40eeddeea089363/tensorboard_data_server-0.6.1-py3-none-manylinux2010_x86_64.whl
tensorboard-plugin-wit @ file:///home/slesage/.cache/pypoetry/artifacts/f5/cd/3b/b958b1d13ecd800c364872138f9f84f0d405fd3b119ceb77f869b4ad72/tensorboard_plugin_wit-1.8.1-py3-none-any.whl
urllib3 @ file:///home/slesage/.cache/pypoetry/artifacts/66/2a/bb/22b56fafb85086d3ee6c6807644cffcd5fa6fc2bc537780143368ab6a9/urllib3-1.26.8-py2.py3-none-any.whl
Werkzeug @ file:///home/slesage/.cache/pypoetry/artifacts/15/3a/86/89704bd3f51d9796b98faa9cca15516723bdc7c61a85ecd9037cbd224a/Werkzeug-2.0.2-py3-none-any.whl
wheel==0.37.0
zipp @ file:///home/slesage/.cache/pypoetry/artifacts/54/a2/32/50907f67584b845d6877c7e224c118ff1db66fc6aed6c6ef86b22ed57f/zipp-3.7.0-py3-none-any.whl

For browser-related issues, please additionally specify:

  • Browser type and version (e.g., Chrome 64.0.3282.140):

Version 15.2 (17612.3.6.1.6)

  • Screenshot, if it’s a visual issue:

Capture d’écran 2022-01-07 à 17 31 21

Issue description

Works on Safari

mkdir test_2.6
cd test_2.6
poetry init
poetry add [email protected]
poetry run tensorboard serve --logdir .

Does not work on Safari

mkdir test_2.7
cd test_2.7
poetry init
poetry add tensorboard
poetry run tensorboard serve --logdir .

Error in the console:

Capture d’écran 2022-01-07 à 17 28 51

@bileschi
Copy link
Collaborator

bileschi commented Jan 7, 2022

Verified can reproduce on my machine at TensorBoard 2.7.0 at http://localhost:6006/

@bileschi bileschi closed this as completed Jan 7, 2022
@bileschi bileschi reopened this Jan 7, 2022
@bileschi
Copy link
Collaborator

bileschi commented Jan 7, 2022

Safari Version 14.1.2 (16611.3.10.1.6)

@bileschi
Copy link
Collaborator

bileschi commented Jan 7, 2022

Hi @severo Sorry for the trouble.

We will gladly accept community contributions here! The first step would be to bisect between 2.6 and 2.7 to see what change triggered the bad Safari behavior. Looking at the error location It's probably related to the move to our line_chart_v2 behavior.

While support for Safari is best effort (per README) this is a significant enough failure that we'll want to fix this.

Aside, I've verified that this is also broken at the current HEAD, so it's not something that we've since fixed.

* 61d11d99e - (2 days ago) Update tensorboard compat protos using tensorflow v2.8.0-rc0. (#5484) - Brian Dubois (HEAD -> master, origin/master, origin/HEAD)

@bileschi
Copy link
Collaborator

bileschi commented Jan 7, 2022

@severo
Copy link
Author

severo commented Jan 7, 2022

With git bisect, I found the issue started with bed15ba / #5238

@bileschi
Copy link
Collaborator

bileschi commented Jan 7, 2022

Awesome! More evidence that we're looking at a dep issue for three. Let's see if there's a better option for us.

@severo
Copy link
Author

severo commented Jan 7, 2022

https://stackoverflow.com/a/67530515/7351594 tells that the issue is resolved with [email protected] and [email protected] but... master already depends on exactly these versions, and is still broken.

@bmd3k
Copy link
Contributor

bmd3k commented Jan 11, 2022

Thanks @severo and @bileschi for your investigation. It saved me quite a bit of time.

I agree with the comments that this problem has surfaced in Angular but that we already have the versions of three and Angular that should solve the problem.

From further investigation, it seems the underlying problem is actually a slight incompatibility between terser and three. Angular worked around the problem by modifying their webpack terser config in this change:

angular/angular-cli@2c2b499

We don't use webpack in TensorBoard, though. So although the root cause and the final error are the same, the path between the two is different.

We explicitly run terser on our js lib. Our config is here:

https://github.com/tensorflow/tensorboard/blob/2.7/tensorboard/defs/terser_config.json

If, like angular/angular-cli@2c2b499, I modify the passes variable from 3 to 2, the problem is not resolved. If I modify it from 3 to 1, though, the problem is resolved.

So we have a possible workaround. I'm going to spend more time thinking about whether it is the right change to make. I'll also consider submitting an issue to three.js to see if they can fix things on their side in parallel.

bmd3k added a commit that referenced this issue Jan 13, 2022
…mpatibility (#5495)

Users have reported problems loading TensorBoard in Safari: #5489

Thanks to @severo and @bileschi we were able to identify the problem to an incompatibility between threejs (which we use for WebGL rendering) and terser (which we use for minimizing/optimizing our code). 

Angular encountered this problem last year and worked around it by changing their terser config by reducing number of passes from 3 to 2: 
* angular/angular-cli#21107
* angular/angular-cli@2c2b499

In our case I have to reduce the number of terser passes from 3 to 1. For some reason reducing to 2 does not solve the problem.

This change surprisingly appears to reduce binary size. Before this change the size of index.js is 7672844 bytes. After this change the size of index.js is 7670992 bytes -- reducing binary size by 1852 bytes.
bmd3k added a commit to bmd3k/tensorboard that referenced this issue Jan 19, 2022
…mpatibility (tensorflow#5495)

Users have reported problems loading TensorBoard in Safari: tensorflow#5489

Thanks to @severo and @bileschi we were able to identify the problem to an incompatibility between threejs (which we use for WebGL rendering) and terser (which we use for minimizing/optimizing our code). 

Angular encountered this problem last year and worked around it by changing their terser config by reducing number of passes from 3 to 2: 
* angular/angular-cli#21107
* angular/angular-cli@2c2b499

In our case I have to reduce the number of terser passes from 3 to 1. For some reason reducing to 2 does not solve the problem.

This change surprisingly appears to reduce binary size. Before this change the size of index.js is 7672844 bytes. After this change the size of index.js is 7670992 bytes -- reducing binary size by 1852 bytes.
bmd3k added a commit that referenced this issue Jan 20, 2022
…mpatibility (#5495)

Users have reported problems loading TensorBoard in Safari: #5489

Thanks to @severo and @bileschi we were able to identify the problem to an incompatibility between threejs (which we use for WebGL rendering) and terser (which we use for minimizing/optimizing our code). 

Angular encountered this problem last year and worked around it by changing their terser config by reducing number of passes from 3 to 2: 
* angular/angular-cli#21107
* angular/angular-cli@2c2b499

In our case I have to reduce the number of terser passes from 3 to 1. For some reason reducing to 2 does not solve the problem.

This change surprisingly appears to reduce binary size. Before this change the size of index.js is 7672844 bytes. After this change the size of index.js is 7670992 bytes -- reducing binary size by 1852 bytes.
@pindinagesh
Copy link

@severo

Could you kindly have look at this PR?, if your issue is resolved so that it can be closed. Thanks!

@severo
Copy link
Author

severo commented Mar 3, 2022

Sure! I thought you would close the issue by yourself. Closing now.

I've followed the work you did so quickly on this bug, it works perfectly, thanks!

@severo severo closed this as completed Mar 3, 2022
@bmd3k
Copy link
Contributor

bmd3k commented Mar 3, 2022

Thanks @severo four double checking! That's my bad: Indeed I probably should have just closed this issue myself.

yatbear pushed a commit to yatbear/tensorboard that referenced this issue Mar 27, 2023
…mpatibility (tensorflow#5495)

Users have reported problems loading TensorBoard in Safari: tensorflow#5489

Thanks to @severo and @bileschi we were able to identify the problem to an incompatibility between threejs (which we use for WebGL rendering) and terser (which we use for minimizing/optimizing our code). 

Angular encountered this problem last year and worked around it by changing their terser config by reducing number of passes from 3 to 2: 
* angular/angular-cli#21107
* angular/angular-cli@2c2b499

In our case I have to reduce the number of terser passes from 3 to 1. For some reason reducing to 2 does not solve the problem.

This change surprisingly appears to reduce binary size. Before this change the size of index.js is 7672844 bytes. After this change the size of index.js is 7670992 bytes -- reducing binary size by 1852 bytes.
dna2github pushed a commit to dna2fork/tensorboard that referenced this issue May 1, 2023
…mpatibility (tensorflow#5495)

Users have reported problems loading TensorBoard in Safari: tensorflow#5489

Thanks to @severo and @bileschi we were able to identify the problem to an incompatibility between threejs (which we use for WebGL rendering) and terser (which we use for minimizing/optimizing our code). 

Angular encountered this problem last year and worked around it by changing their terser config by reducing number of passes from 3 to 2: 
* angular/angular-cli#21107
* angular/angular-cli@2c2b499

In our case I have to reduce the number of terser passes from 3 to 1. For some reason reducing to 2 does not solve the problem.

This change surprisingly appears to reduce binary size. Before this change the size of index.js is 7672844 bytes. After this change the size of index.js is 7670992 bytes -- reducing binary size by 1852 bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants