-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Error launching TensorBoard on Windows due to %s
strftime specifier
#1895
Comments
Find the manger.py file in directory ..\Lib\site-packages\tensorboard,and modify dt.strftime("%s") to dt.strftime("%S") |
@wchargin can you please TAL? It seems like something we should be able to fix. |
Hm, it looks like The recommended workarounds are truly sad, but I guess we should change it to one of those. FWIW, changing to |
Summary: Fixes #1895 by replacing the (apparently unportable) `%s` format specifier with an explicit subtraction from epoch. Test Plan: I don’t have easy access to a Windows machine with a Bazel/TensorBoard setup, but I verified that this expression can be evaluated by itself: ``` Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> import datetime >>> dt = datetime.datetime.now() >>> dt.strftime("%s") Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> dt.strftime("%s") ValueError: Invalid format string >>> int((dt - datetime.datetime.fromtimestamp(0)).total_seconds()) 1551203889 ``` Running `git grep strftime.*%s` returns no matches as of this commit. wchargin-branch: windows-strftime
%s
strftime specifier
Summary: Fixes #1895 by replacing the (apparently unportable) `%s` format specifier with an explicit subtraction from epoch. Test Plan: I don’t have easy access to a Windows machine with a Bazel/TensorBoard setup, but I verified that this expression can be evaluated by itself: ``` Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> import datetime >>> dt = datetime.datetime.now() >>> dt.strftime("%s") Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> dt.strftime("%s") ValueError: Invalid format string >>> int((dt - datetime.datetime.fromtimestamp(0)).total_seconds()) 1551203889 ``` Running `git grep strftime.*%s` returns no matches as of this commit. wchargin-branch: windows-strftime
you can change the ("strftime("%s") to strftime("%S") ==> %s to %S") on line 50 in (site-packages\tensorboard\manager.py ) |
@israfila3: As noted above, that is not a sound replacement. Please see |
Summary: Fixes tensorflow#1895 by replacing the (apparently unportable) `%s` format specifier with an explicit subtraction from epoch. Test Plan: I don’t have easy access to a Windows machine with a Bazel/TensorBoard setup, but I verified that this expression can be evaluated by itself: ``` Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> import datetime >>> dt = datetime.datetime.now() >>> dt.strftime("%s") Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> dt.strftime("%s") ValueError: Invalid format string >>> int((dt - datetime.datetime.fromtimestamp(0)).total_seconds()) 1551203889 ``` Running `git grep strftime.*%s` returns no matches as of this commit. wchargin-branch: windows-strftime
Summary: Fixes #1895 by replacing the (apparently unportable) `%s` format specifier with an explicit subtraction from epoch. Test Plan: I don’t have easy access to a Windows machine with a Bazel/TensorBoard setup, but I verified that this expression can be evaluated by itself: ``` Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> import datetime >>> dt = datetime.datetime.now() >>> dt.strftime("%s") Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> dt.strftime("%s") ValueError: Invalid format string >>> int((dt - datetime.datetime.fromtimestamp(0)).total_seconds()) 1551203889 ``` Running `git grep strftime.*%s` returns no matches as of this commit. wchargin-branch: windows-strftime
TensorBoard version: 1.13.0
Tensorflow version: tensorflow-gpu 1.13.0rc2
OS Platform and version: Windows10 1803
Python version: 3.7
Hi,
Here's a minor error occurs when I run tensorboard 1.13.0. It is fixed by changing line 50 in tensorboard/manager.py
serialize=lambda dt: int(dt.strftime("%s")),
toserialize=lambda dt: int(dt.strftime("%S")),
The "%s" is changed to "%S".
The text was updated successfully, but these errors were encountered: