-
Notifications
You must be signed in to change notification settings - Fork 1.7k
build: include __init__.py in //tensorboard
#3485
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
Conversation
Summary: Needed for `tensorboard.__version__` to resolve, as used by (e.g.) the What-If Tool. Fixes #3484. Test Plan: Running `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` installed now works, instead of failing with: ``` File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' terminate called without an active exception Fatal Python error: Aborted ``` wchargin-branch: build-include-init
stephanwlee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need "//tensorboard:lib", # User-facing overall TensorBoard API on build_pip_package anymore?
Summary: Prior to this change, any exception raised from `loader.load()` would crash TensorBoard (see, e.g., #3484). As of this patch, we log an error, drop the plugin, and continue loading. Test Plan: Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in #3485. Note that TensorBoard now prints: ``` E0406 09:57:12.844471 139872056727360 application.py:260] Failed to invoke plugin loader WhatIfToolPluginLoader.load Traceback (most recent call last): File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp plugin = loader.load(context) File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit) ``` wchargin-branch: application-load-failure-robustness
|
You’re right that it’s not strictly necessary, but I think that it’s Does this sound reasonable to you, or would you prefer that I remove it? |
|
Ah, strict deps. I forgot that building pip package uses the init. Current change LGTM. |
Summary: Prior to this change, any exception raised from `loader.load()` would crash TensorBoard (see, e.g., #3484). As of this patch, we log an error, drop the plugin, and continue loading. Test Plan: Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in #3485 (i.e., run `git revert e59e9c4`). Note that TensorBoard now prints: ``` E0406 11:00:39.494363 140089282381632 application.py:260] Failed to load plugin WhatIfToolPluginLoader.load; ignoring it. Traceback (most recent call last): File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp plugin = loader.load(context) File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit) ``` wchargin-branch: application-load-failure-robustness
Summary: Needed for `tensorboard.__version__` to resolve, as used by (e.g.) the What-If Tool. Fixes tensorflow#3484. Test Plan: Running `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` installed now works, instead of failing with: ``` File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' terminate called without an active exception Fatal Python error: Aborted ``` wchargin-branch: build-include-init
Summary: Prior to this change, any exception raised from `loader.load()` would crash TensorBoard (see, e.g., tensorflow#3484). As of this patch, we log an error, drop the plugin, and continue loading. Test Plan: Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in tensorflow#3485 (i.e., run `git revert e59e9c4`). Note that TensorBoard now prints: ``` E0406 11:00:39.494363 140089282381632 application.py:260] Failed to load plugin WhatIfToolPluginLoader.load; ignoring it. Traceback (most recent call last): File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp plugin = loader.load(context) File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit) ``` wchargin-branch: application-load-failure-robustness
Summary: Needed for `tensorboard.__version__` to resolve, as used by (e.g.) the What-If Tool. Fixes #3484. Test Plan: Running `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` installed now works, instead of failing with: ``` File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' terminate called without an active exception Fatal Python error: Aborted ``` wchargin-branch: build-include-init
Summary: Prior to this change, any exception raised from `loader.load()` would crash TensorBoard (see, e.g., #3484). As of this patch, we log an error, drop the plugin, and continue loading. Test Plan: Run `bazel run //tensorboard -- --logdir /tmp/logs` in a virtualenv with `tensorboard-plugin-wit==1.6.0.post3` but *without* the patch in #3485 (i.e., run `git revert e59e9c4`). Note that TensorBoard now prints: ``` E0406 11:00:39.494363 140089282381632 application.py:260] Failed to load plugin WhatIfToolPluginLoader.load; ignoring it. Traceback (most recent call last): File ".../tensorboard/backend/application.py", line 255, in TensorBoardWSGIApp plugin = loader.load(context) File "/VIRTUAL_ENV/lib/python3.7/site-packages/tensorboard_plugin_wit/wit_plugin_loader.py", line 51, in load version = pkg_resources.parse_version(tensorboard.__version__) AttributeError: module 'tensorboard' has no attribute '__version__' Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all TensorBoard 2.3.0a0 at http://localhost:6006/ (Press CTRL+C to quit) ``` wchargin-branch: application-load-failure-robustness
Summary:
Needed for
tensorboard.__version__to resolve, as used by (e.g.) theWhat-If Tool. Fixes #3484.
Test Plan:
Running
bazel run //tensorboard -- --logdir /tmp/logsin a virtualenvwith
tensorboard-plugin-wit==1.6.0.post3installed now works, insteadof failing with:
wchargin-branch: build-include-init