Skip to content

Blank Page in Browser (and other error) #3117

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

Closed
D-Niermann opened this issue Jan 7, 2020 · 34 comments
Closed

Blank Page in Browser (and other error) #3117

D-Niermann opened this issue Jan 7, 2020 · 34 comments

Comments

@D-Niermann
Copy link

D-Niermann commented Jan 7, 2020

When starting tensorboard I only get a blank white page. Tested on multiple browsers and scripts. I just updated to the new Tensorflow 2.0, yesterday with the older version it worked. If I mark the page it just shows 4 blue vertical lines. Inspecting the web page with chrome shows a lot of html code. Using VSCode, Win10 Chrome and Firefox.

I start tensorboard with any of these:
tensorboard --logdir ./logs
tensorboard --logdir ./logs --bind_all
tensorboard --logdir ./logs --host localhost --port 8080

Results are the same.

strange other error

Also I get a strange error now with the new version if I take the official example and create the log_dir in the following way:
log_dir="logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
It raises the error "tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: logs/fit/20200107-131107\train; No such file or directory [Op:CreateSummaryFileWriter]"
So I have to use os.path.join or just take no subdirectories.

Example file to reconstruct error

from datetime import datetime
import tensorflow as tf

mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()

def create_model():
  return tf.keras.models.Sequential([
    tf.keras.layers.Flatten(input_shape=(28, 28)),
    tf.keras.layers.Dense(512, activation='relu'),
    tf.keras.layers.Dropout(0.2),
    tf.keras.layers.Dense(10, activation='softmax')
  ])


model = create_model()
model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

log_dir= datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir, histogram_freq=1)

model.fit(x=x_train, 
          y=y_train, 
          epochs=1, 
          validation_data=(x_test, y_test), 
          callbacks=[tensorboard_callback])


Diagnostics

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

--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=6, 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=17763, platform=2, service_pack='')

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

--- check: installed_packages
INFO: installed: tensorboard==2.1.0
INFO: installed: tensorflow==2.0.0
INFO: installed: tensorflow-estimator==2.0.1

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

--- check: tensorflow_python_version
INFO: tensorflow.__version__: '2.0.0'
INFO: tensorflow.__git_version__: 'v2.0.0-rc2-26-g64c3d382ca'

--- check: tensorboard_binary_path
INFO: which tensorboard: b'C:\\Python3\\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(): 'dnpc.ddns.lcl'

--- check: stat_tensorboardinfo
INFO: directory: C:\Users\Public\Documents\Wondershare\CreatorTemp\.tensorboard-info
INFO: os.stat(...): os.stat_result(st_mode=16895, st_ino=3096224744537609, st_dev=1926005927, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1578399251, st_mtime=1578399251, st_ctime=1578397643)
INFO: mode: 0o40777

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (1): ['C:\\Python3\\lib\\site-packages']; bad_roots (0): []

--- check: full_pip_freeze
INFO: pip freeze --all:
absl-py==0.7.0
astor==0.7.1
attrs==19.1.0
backcall==0.1.0
bayespy==0.5.18
bleach==3.1.0
cachetools==4.0.0
certifi==2019.3.9
chardet==3.0.4
click==7.0
clickclick==1.2.2
colorama==0.4.1
connexion==1.1.15
cycler==0.10.0
Cython==0.29.11
decorator==4.3.2
defusedxml==0.5.0
dlib==19.17.0
entrypoints==0.3
flask==1.0.3
gast==0.2.2
gmplot==1.2.0
google-auth==1.10.0
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
gpx-parser==0.0.4
grpcio==1.26.0
h5py==2.9.0
idna==2.8
imageio==2.5.0
importlib==1.0.4
inflection==0.3.1
ipykernel==5.1.0
ipython==7.3.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
itsdangerous==1.1.0
jedi==0.13.3
Jinja2==2.10
joblib==0.13.2
jsonschema==3.0.1
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.0.8
kiwisolver==1.0.1
Markdown==3.0.1
MarkupSafe==1.1.1
matplotlib==3.0.2
mistune==0.8.4
nbconvert==5.4.1
nbformat==4.4.0
networkx==2.2
notebook==5.7.4
numpy==1.16.1
oauthlib==3.1.0
openapi-spec-validator==0.2.7
opt-einsum==3.1.0
pandas==0.24.1
pandocfilters==1.4.2
parso==0.3.4
pickleshare==0.7.5
Pillow==6.0.0
pip==19.2.3
primo==1.0
prometheus-client==0.6.0
prompt-toolkit==2.0.9
protobuf==3.6.1
pyasn1==0.4.8
pyasn1-modules==0.2.7
Pygments==2.3.1
pykalman==0.9.5
pyparsing==2.3.1
PyQt5==5.12.1
PyQt5-sip==4.19.15
pyrsistent==0.14.11
python-dateutil==2.6.0
pytz==2018.9
pywinpty==0.5.5
pyyaml==5.1
pyzmq==18.0.1
qtconsole==4.4.3
requests==2.21.0
requests-oauthlib==1.3.0
rsa==4.0
scikit-learn==0.21.2
scipy==1.3.3
seaborn==0.9.0
Send2Trash==1.5.0
setuptools==44.0.0
six==1.12.0
sklearn==0.0
swagger-server==1.0.0
swagger-spec-validator==2.4.3
tensorboard==2.1.0
tensorflow==2.0.0
tensorflow-estimator==2.0.1
termcolor==1.1.0
terminado==0.8.1
testpath==0.4.2
tornado==6.0.1
traitlets==4.3.2
typing==3.6.2
urllib3==1.24.3
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
wheel==0.32.3
widgetsnbextension==3.4.2
wrapt==1.11.2

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.

@D-Niermann D-Niermann changed the title Blank Page in Browser Blank Page in Browser (and other error) Jan 7, 2020
@psybuzz
Copy link
Contributor

psybuzz commented Jan 7, 2020

Thanks for the report. If the 2 issues reported have different root causes, it may make sense to split this into 2 reports later.

1st issue

just shows 4 blue vertical lines

Could you please send a screenshot? When inspecting the page with Chrome, are there any errors in the "Console"?

2nd issue
Was this issue also happening in older versions of TensorBoard?
The error looks similar to one in ibab/tensorflow-wavenet#255. Could you please try the workaround in that thread and let us know if it works?

@D-Niermann
Copy link
Author

D-Niermann commented Jan 8, 2020

1st issue

Ok here are two screenshots. The console indeed shows an error. I googled it and it seems to be a problem that needs a fix in the registry, but I have the needed value missing, so I have to see what I do next.
The blank tensorboard page:
screen1
The console output:
screen2

2nd issue

I tried this and it works now, thanks ! (It is still kinda a bug I would say)

log_dir= ".\\logs\\test\\"+datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir, histogram_freq=1)

@ReinforcedMan
Copy link

ReinforcedMan commented Jan 8, 2020

Reporting that I have the same error in the browser. Tensorflow 2.0.0, tensorboard 2.1.0, tested in both firefox and chrome on windows 10. The installation is fresh from yesterday. Errors:

  • In Chrome:

Refused to execute script from 'http://localhost:16838/index.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

  • In Firefox:

The resource from “http://localhost:16838/index.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff)

The error was fixed by switching back to tensorboard 2.0.0.

pip uninstall tensorboard
pip install tensorboard==2.0.0

@stephanwlee
Copy link
Contributor

stephanwlee commented Jan 8, 2020

This looks like the same issue as this one: #3077. More context here: #2771

Can you please check the registry and make sure mimetype for JavaScript is not set to plaintext?

@D-Niermann
Copy link
Author

The issue was fixed by downgrading to tensorboard 2.0!

My Registry at Computer\HKEY_CLASSES_ROOT\.js has a value Content Type set to text/plain. I suppose its about that value. Here is an image of all values there:
s1

I previously navigated to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js because there supposedly should be such a value, but there wasn't. So I created it and set it to application/javascript and it didn't solve the issue.

@ReinforcedMan
Copy link

ReinforcedMan commented Jan 8, 2020

@stephanwlee

I do have the mimetype set to test/plain. However, if something like visual studio makes tensorboard unusable without changing the registry as suspected by @wchargin, I think it probably deserves a fix as the proportion of people using visual studio is non negligible.

It works with tensorboard 2.0.0, so a fix could probably be found.

@wchargin
Copy link
Contributor

wchargin commented Jan 8, 2020

navigated to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js
because there supposedly should be such a value, but there wasn't. So
I created it and set it to application/javascript and it didn't
solve the issue.

My understanding is that HKCR is the preferred view because it shows a
union of HKLM and some other registry paths, which is why I mentioned
HKCR specifically in #3077 and #2771.

if something like visual studio makes tensorboard unusable without
changing the register as suspected by @wchargin, I think it probably
deserves a fix as the proportion of people using visual studio is non
negligible.

We’ve discussed this a bit internally and are probably willing to hack
around this on our side, given that it breaks a substantial portion of
users, even though the problem isn’t our fault.

I’ve filed #3120 to track this.

@princessofpillows
Copy link

Yea, same issue. Current workaround is downgrading to tensorboard-2.0.2. This is definitely an issue with the new release.

@wchargin
Copy link
Contributor

I’ve drafted a patch for this that works around the problem on broken
Windows systems. The code is in #3128. Please give us a few days to sort
out some issues regarding nightly builds. Then, we can provide a nightly
package that you can install to verify the fix. If all goes well, we may
perform a point release of TensorBoard 2.1.1 with this fix.

@johnpjust
Copy link

johnpjust commented Jan 12, 2020

I'm getting the same issue of a blank page....#35804

I also tried two different machines.

@forReason
Copy link

forReason commented Jan 13, 2020

same here. lokking forward for a nightly.
By the Way, Internet Explorer shows some stuff-ish. I think this is current Security Behavior. Its a Feature. Not a Bug.
There might be a browser displaying tensorboard2.1 Correctly?

Within my Regitry there is no such value as mentioned in #3077
Edit:
A google search on the topic brings up that this is mostly caused by incorrectly configured server. or missing link

@wchargin
Copy link
Contributor

Within my Regitry there is no such value as mentioned in #3077

@forReason: Could you please post the output of

python -c "import mimetypes; print(list(mimetypes.guess_type('index.js')))"

on your machine?

By the Way, Internet Explorer shows some stuff-ish. I think this is
current Security Behavior. Its a Feature. Not a Bug.

Right. That TensorBoard only shows a blank page is clearly a bug, but
the underlying mechanism is an intentional security mechanism, so we
can’t endorse workarounds that suggest just disabling it. TensorBoard
only appears to work in Internet Explorer because IE is not correctly
handling the nosniff header.

lokking forward for a nightly.

We’re working for it—my apologies for the delay.

@forReason
Copy link

@wchargin I hope this is what you ment:

On the Server which Tensorboard is running on:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\drgadmin>python -c "import mimetypes; print(list(mimetypes.guess_type('index.js')))"
['text/plain', None]

C:\Users\drgadmin>

On the Client which is accessing Tensorboard through Google Chrome:

Microsoft Windows [Version 10.0.18363.592]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\julia>python -c "import mimetypes; print(list(mimetypes.guess_type('index.js')))"
['application/javascript', None]

C:\Users\julia>

@wchargin
Copy link
Contributor

@forReason: Yes, thanks. The fact that the server gives text/plain
indicates that you’re hitting the same issue as everyone else here
(probably a bad registry entry, but could also be a bad system file
somewhere), which is expected to be fixed by this patch. Stay tuned.

@forReason
Copy link

@wchargin indeed. I found the regkey on the server and changed it. Fixed the Issue for me!

@codeninja
Copy link

codeninja commented Jan 22, 2020

chiming in to say that I'm experiencing the same issue as of 1/22/20

image

@wchargin
Copy link
Contributor

Thank you all for your patience. We’ve gotten our nightlies rolling
again.

Please try uninstalling tensorflow and tensorboard and then
installing the latest tf-nightly, which will pull in the latest
TensorBoard tb-nightly. (Uninstalling first is necessary to prevent
Pip from corrupting your installation; using the latest tf-nightly is
necessary because the latest tb-nightly depends on nightly-only
TensorFlow features.)

On my Windows machine, this suffices to work around the problem.

I’ll leave this open for a bit; please let us know if this works for you
or if it doesn’t. We’ll also consider publishing a patch release so that
you don’t have to upgrade to the latest TensorFlow nightly.

@OverLordGoldDragon
Copy link

@wchargin This did solve the blank TensorBoard problem, but now I have a blank Profiler problem.

e-hat added a commit to e-hat/mnistgan that referenced this issue Feb 19, 2020
@Srijan1214
Copy link

I have the same issue. So frustrating. Been hours since I have been trying to fix it.

from tensorflow.keras.callbacks import TensorBoard
import time
NAME = "ResNet-mnts-{}".format(int(time.time()))
tensorboard = TensorBoard(log_dir="logs{}".format(NAME))

image

image

No Combination of the --logdir="logs" seem to be working

@psybuzz
Copy link
Contributor

psybuzz commented Mar 10, 2020

@Srijan1214 , thanks for the comment, the issue you posted looks like a different one from this broken profiler issue.

Based on the Console output (thanks for the screenshots!) it looks like #3120, a bug where incorrect mimetypes interfere with TensorBoard. For more updates / questions, I would post on the the other Github issue.

That bug was fixed in TensorBoard's 2.1.1 release, could you please try upgrading TensorBoard to 2.1.1 or greater and see if it works?

EDIT: whoops sorry, I misread this issue, but I think your post is relevant here. The fix (#3128) should still be part of the TensorBoard 2.1.1 release.

EDIT 2: sorry again, the fix is actually in TB 2.2.0, not 2.1.1.

@Haxxardoux
Copy link

I was having this issue in 2.1.1, completely blank screen yet commands like
tensorboard --logdir .\Tensorflow\logs\fit\20200313-131520 --inspect
return what i expect it to. I checked to see if i was having the same issue as @Srijan1214, and sure enough...

image

At the advice of @wchargin, i uninstalled 2.1.1 and installed tf-nightly, but this did not seem to fix the issue above.

image

Still returned blank screen in any browser i tested it in. Any suggestions would be appreciated!

@GuilhermeRossato
Copy link

GuilhermeRossato commented Mar 28, 2020

I have a 10 days old windows instalation and this problem was plaguing me already, so I developed a temporary workaround for people coming here from searching all over the internet that doesn't involve changing registry (which usually is a better solution, except on my case):

First, check if you have the problem by running cmd.exe and executing the following:

python -c "import mimetypes; print(list(mimetypes.guess_type('index.js')))"

A correct output would be ['application/javascript', None], if you don't see that, proceed to fix:

mimetypes is usually found at C:\python38\Lib\mimetypes.py, there's a method guess_type at line 97 (may change depending on your version)

After the comment, add these lines at the start of the function (lines 116 and 117):

        if (isinstance(url, str) and url[-3:] == '.js'):
            return 'application/javascript', None

Then, run the console command again to check if it worked (it should print correctly).

Note: If you have tensorboard running while you fix it, you'll need to restart the process (tensorboard.exe) to clear its cache.

This was enough for me to transform the 100% blank page to a fully functional page from tensorboard.

@psybuzz
Copy link
Contributor

psybuzz commented Apr 8, 2020

Sorry all, my comment earlier was incorrect. The fix #3128 is actually present in TensorBoard 2.2.0, not in 2.1.1.

If anyone is seeing this issue, please upgrade to TensorBoard 2.2 or higher, and let us know if you still see a blank screen.

Thanks for the investigation from all! Closing this, since the root caused is fixed by #3128

@epsi95
Copy link

epsi95 commented Apr 16, 2020

I faced the text/plain issue in tensorboard==2.1.1. I uninstalled it and installed tensorboard==2.0.0 and with tensorboard --logdir=.\logs everything is working fine. So the point is the issue is present in 2.1.1

@Terkea
Copy link

Terkea commented May 22, 2020

installing and uninstalling tensorboard fixed the issue in my case.

@ismael-elatifi
Copy link

ismael-elatifi commented Jun 27, 2020

I had the same issue with Tensorboard 2.1.1 showing only totally blank page, after installation Visual Studio 2017.
Reinstalling the 2.1.1 did not help but upgrading to the 2.2.2 solved the issue !
So there is some bug in the 2.1.1 which is fixed in the 2.2.2.

@hellosaumil
Copy link

Running TensorBoard 2.4.0 on Windows 10 and getting the same blank page issue.

@bumpmann
Copy link

bumpmann commented Mar 7, 2021

Same issue with 2.4 and 2.3, i had to downgrade to 2.2

@hellosaumil
Copy link

Running TensorBoard 2.4.0 on Windows 10 and getting the same blank page issue.

Need to reopen this issue!

@RohanGautam
Copy link

Same issue persists with Tensorboard 2.5.0 on linux (Pop!_OS 20.10 x86_64)

@psybuzz
Copy link
Contributor

psybuzz commented Jul 7, 2021

For the folks who've been seeing a blank TensorBoard recently after 2.2, could you share the following info?

  • Run python -c "import mimetypes; print(list(mimetypes.guess_type('index.js')))" in the same environment you use to run TensorBoard, and report the output
  • In the blank TensorBoard page, open the devtools console, and share any JS errors

Since TB was patched to hardcode mimetypes for *.js, I'm not sure why the TB server would return incorrect mimetypes, so I'm curious whether these reports of a blank page might be from a different root cause.

@AndreiRoibu
Copy link

I recently started having this issue with TensorBoard 2.7.0 in Safari. A blank screen appears and nothing I do seems to be fixing it.

The output requested from running the python command is: ['application/javascript', None]

@nfelt
Copy link
Contributor

nfelt commented Oct 30, 2021

@AndreiRoibu this sounds like it might be a different issue. Can you open a new issue, and fill out the issue template and run the self-diagnosis script?

@JVGD
Copy link

JVGD commented Dec 14, 2021

I have the same here as @AndreiRoibu, however when opening it in firefox it works, would it be something like cookies or a conf related issue with safari defaults settings?

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