question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to install TensorBoard module in python env using bazel

See original GitHub issue

I follow READER.md to install TensorBoard, That’s ok,

bazel build tensorboard:tensorboard
./bazel-bin/tensorboard/tensorboard --logdir path/to/logs

But I cannot find TensorBoard in python env

(tensorboard-dev) [root@hwtnode ~]# python -c "import tensorboard"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorboard'
(tensorboard-dev) [root@hwtnode ~]#

Environment information (required)

(tensorboard-dev) [root@hwtnode repos]# python tensorboard/tensorboard/tools/diagnose_tensorboard.py

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=9, releaselevel='final', serial=0)
INFO: os.name: posix
INFO: os.uname(): posix.uname_result(sysname='Linux', nodename='hwtnode', release='3.10.0-862.11.6.el7.x86_64', version='#1 SMP Tue Aug 14 21:49:04 UTC 2018', machine='x86_64')
INFO: sys.getwindowsversion(): N/A

--- check: package_management
INFO: has conda-meta: False
INFO: $VIRTUAL_ENV: '/root/tensorboard-dev'

--- check: installed_packages
WARNING: no installation among: ['tb-nightly', 'tensorboard', 'tensorflow-tensorboard']
INFO: installed: tensorflow==1.14.0
INFO: installed: tensorflow-estimator==1.14.0

--- check: tensorboard_python_version
Traceback (most recent call last):
  File "tensorboard/tensorboard/tools/diagnose_tensorboard.py", line 470, in main
    suggestions.extend(check())
  File "tensorboard/tensorboard/tools/diagnose_tensorboard.py", line 78, in wrapper
    result = fn()
  File "tensorboard/tensorboard/tools/diagnose_tensorboard.py", line 246, in tensorboard_python_version
    from tensorboard import version
ModuleNotFoundError: No module named 'tensorboard'

--- check: tensorflow_python_version
/root/tensorboard-dev/lib64/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/root/tensorboard-dev/lib64/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/root/tensorboard-dev/lib64/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/root/tensorboard-dev/lib64/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/root/tensorboard-dev/lib64/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/root/tensorboard-dev/lib64/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Limited tf.compat.v2.summary API due to missing TensorBoard installation.
INFO: tensorflow.__version__: '1.14.0'
INFO: tensorflow.__git_version__: 'v1.14.0-rc1-22-gaf24dc91b5'

--- check: tensorboard_binary_path
which: no tensorboard in (/root/tensorboard-dev/bin:/opt/node/bin:/opt/rh/rh-python36/root/usr/bin:/opt/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin:/root/bin)
INFO: which tensorboard: None

--- 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_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(): 'hwtnode'

--- check: stat_tensorboardinfo
INFO: directory: /tmp/.tensorboard-info
INFO: os.stat(...): os.stat_result(st_mode=16895, st_ino=2951129959, st_dev=64, st_nlink=2, st_uid=0, st_gid=0, st_size=27, st_atime=1582294975, st_mtime=1583398334, st_ctime=1583398334)
INFO: mode: 0o40777

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (0): []; bad_roots (0): []

--- check: full_pip_freeze
INFO: pip freeze --all:
absl-py==0.9.0
astor==0.8.1
attrs==19.3.0
backcall==0.1.0
bleach==3.1.1
cachetools==4.0.0
captum==0.2.0
certifi==2019.11.28
chardet==3.0.4
Click==7.0
cycler==0.10.0
decorator==4.4.1
defusedxml==0.6.0
dill==0.3.1.1
entrypoints==0.3
Flask==1.1.1
gast==0.3.3
google-auth==1.11.2
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
grpcio==1.27.2
h5py==2.10.0
idna==2.9
importlib-metadata==1.5.0
ipdb==0.12.3
ipykernel==5.1.4
ipython==7.12.0
ipython-genutils==0.2.0
itsdangerous==1.1.0
jedi==0.16.0
Jinja2==2.11.1
jsonschema==3.2.0
jupyter-client==6.0.0
jupyter-core==4.6.3
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
Markdown==3.2.1
MarkupSafe==1.1.1
matplotlib==3.1.3
mistune==0.8.4
nbconvert==5.6.1
nbformat==5.0.4
notebook==6.0.3
numpy==1.18.1
oauthlib==3.1.0
pandocfilters==1.4.2
parso==0.6.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.0.0
pip==20.0.2
prometheus-client==0.7.1
prompt-toolkit==3.0.3
protobuf==3.11.3
ptyprocess==0.6.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
Pygments==2.5.2
pyparsing==2.4.6
pyrsistent==0.15.7
PySnooper==0.3.0
python-dateutil==2.8.1
pyzmq==19.0.0
requests==2.23.0
requests-oauthlib==1.3.0
rsa==4.0
Send2Trash==1.5.0
setuptools==45.2.0
six==1.14.0
-e git+https://github.com/tensorflow/tensorboard.git@799c5cf6ae1f5f8d78a09382689dcb9d0ec5f561#egg=tensorboard_plugin_example&subdirectory=tensorboard/examples/plugins/example_basic
tensorflow==1.14.0
tensorflow-estimator==1.14.0
termcolor==1.1.0
terminado==0.8.3
testpath==0.4.4
torch==1.4.0
torchvision==0.5.0
tornado==6.0.3
traitlets==4.3.3
urllib3==1.25.8
wcwidth==0.1.8
webencodings==0.5.1
Werkzeug==1.0.0
wheel==0.34.2
wrapt==1.12.0
zipp==3.0.0

My question:

Does bazel build will not build TensorBoard python package? How can I build and install TensorBoard python package using TensorBoard source code?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
nfeltcommented, Mar 6, 2020

bazel build tensorboard:tensorboard produces a “binary” which is a script that launches a python interpreter to run the main.py for TensorBoard, and this script is specially configured to look for Python source files that were built with Bazel.

The build doesn’t in any way update the normal Python environment that you have available.

If you want to build and install the TensorBoard pip package locally, you’ll want to run instead the following from within a Python 3 virtual environment (first uninstalling tensorboard if you already had a pip package for it installed):

$ pip uninstall -y tensorboard tb-nightly tensorboard-plugin-wit
$ bazel run //tensorboard/pip_package:extract_pip_package -- /tmp/tb
$ pip install --upgrade /tmp/tb/tensorboard*py3*.whl
0reactions
hexiaotingcommented, Mar 9, 2020

@nfelt That’s exactly what I want, thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Update 1] How to build and install TensorFlow GPU/CPU ...
Step 1: Install Git for Windows · Step 2: Install MSYS2 x64 and command line tools · Step 3: Install Visual Studio 2017...
Read more >
Tensorflow install from Source (Win7): bazel, python
Use Python -trained (keras) model in c/c++. See section work-around for c-work-around. Compile Tensorflow from source (rev 1.0 or 1.2.1) ...
Read more >
Build from source on Windows - Install
Setup for Windows. Install Python and the TensorFlow package dependencies; Install Bazel; Install MSYS2; Install Visual C++ Build Tools 2019 ...
Read more >
TensorFlow - Download and Setup
Installing from sources: Install TensorFlow by building a pip wheel that you then install using pip. If you are familiar with Pip, Virtualenv,...
Read more >
Installation | mediapipe - Google
Note: To make Mediapipe work with TensorFlow, please set Python 3.7 as the default Python version and install the Python “six” library by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found