tensorflow / tensorflow/tensorboard

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Open
#5,647 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.2k
Forks
1.7k
Avg merge
4d 22h
Merged PRs (30d)
1

Description

Consider Stack Overflow for getting support using TensorBoard—they have
a larger community with better searchability:

https://stackoverflow.com/questions/tagged/tensorboard

Do not use this template for for setup, installation, or configuration
issues. Instead, use the “installation problem” issue template:

https://github.com/tensorflow/tensorboard/issues/new?template=installation_problem.md

To report a problem with TensorBoard itself, please fill out the
remainder of this template.

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:

https://raw.githubusercontent.com/tensorflow/tensorboard/master/tensorboard/tools/diagnose_tensorboard.py

`### Diagnostics

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

--- check: general
INFO: sys.version_info: sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)
INFO: os.name: posix
INFO: os.uname(): posix.uname_result(sysname='Linux', nodename='csdl-X299-UD4-Pro', release='5.4.0-89-generic', version='#100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021', machine='x86_64')
INFO: sys.getwindowsversion(): N/A

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

--- check: installed_packages
INFO: installed: tensorboard==2.8.0
INFO: installed: tensorflow-gpu==2.7.0
INFO: installed: tensorflow==2.8.0
WARNING: conflicting installations: ['tensorflow', 'tensorflow-gpu']
INFO: installed: tf-estimator-nightly==2.8.0.dev2021122109
INFO: installed: tensorflow-estimator==2.7.0
WARNING: conflicting installations: ['tensorflow-estimator', 'tf-estimator-nightly']
INFO: installed: tensorboard-data-server==0.6.1

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

--- check: tensorflow_python_version
INFO: tensorflow.__version__: '2.8.0'
INFO: tensorflow.__git_version__: 'v2.8.0-rc1-32-g3f878cff5b6'

--- check: tensorboard_data_server_version
INFO: data server binary: '/home/eran/.local/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'/usr/local/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(): 'csdl-X299-UD4-Pro'

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

--- check: source_trees_without_genfiles
INFO: tensorboard_roots (2): ['/home/eran/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages']; bad_roots (0): []

--- check: full_pip_freeze
INFO: pip freeze --all:
absl-py==1.0.0
aiohttp==3.7.4.post0
alembic==1.7.4
apache-beam==2.34.0
appdirs==1.4.3
apturl==0.5.2
argcomplete==1.12.3
argon2-cffi==21.1.0
asttokens==2.0.5
astunparse==1.6.3
async-timeout==3.0.1
attrs==21.2.0
autokeras==1.0.16.post1
autopage==0.4.0
avro-python3==1.9.2.1
awscli==1.18.69
backcall==0.2.0
bcrypt==3.1.7
bleach==4.1.0
blinker==1.4
boto==2.49.0
botocore==1.16.19
Brlapi==0.7.0
cachetools==4.2.4
certifi==2019.11.28
cffi==1.15.0
chardet==3.0.4
charset-normalizer==2.0.7
chex==0.1.0
clang==5.0
Click==7.0
cliff==3.9.0
cloudpickle==2.0.0
clu==0.0.6
cmaes==0.8.2
cmd2==2.2.0
colorama==0.4.3
colorlog==6.6.0
command-not-found==0.3
contextlib2==21.6.0
crcmod==1.7
cryptography==35.0.0
cupshelpers==1.0
cycler==0.10.0
Cython==0.29.26
dbus-python==1.2.16
debugpy==1.5.1
decorator==5.1.0
defer==1.0.6
defusedxml==0.7.1
dill==0.3.1.1
discord.py==1.7.3
distlib==0.3.0
distro==1.4.0
distro-info===0.23ubuntu1
dm-tree==0.1.6
docopt==0.6.2
docutils==0.16
duplicity==0.8.12.0
einops==0.3.2
entrypoints==0.3
executing==0.8.2
fastavro==1.4.7
fasteners==0.14.1
filelock==3.0.12
flatbuffers==1.12
flax==0.3.6
future==0.18.2
gast==0.4.0
gcs-oauth2-boto-plugin==3.0
gevent==21.12.0
gin==0.1.6
gin-config==0.5.0
google-api-core==1.31.4
google-api-python-client==1.12.8
google-apitools==0.5.31
google-auth==1.35.0
google-auth-httplib2==0.1.0
google-auth-oauthlib==0.4.6
google-cloud-bigquery==2.30.1
google-cloud-bigquery-storage==2.10.1
google-cloud-bigtable==1.7.0
google-cloud-core==1.7.2
google-cloud-datastore==1.15.3
google-cloud-dlp==1.0.0
google-cloud-language==1.3.0
google-cloud-pubsub==1.7.0
google-cloud-recommendations-ai==0.2.0
google-cloud-spanner==1.19.1
google-cloud-videointelligence==1.16.1
google-cloud-vision==1.0.0
google-crc32c==1.3.0
google-pasta==0.2.0
google-reauth==0.1.1
google-resumable-media==2.1.0
googleapis-common-protos==1.53.0
graphviz==0.18
greenlet==1.1.2
grpc-google-iam-v1==0.12.3
grpcio==1.34.1
grpcio-gcp==0.2.2
gsutil==5.4
guppy3==3.1.2
h5py==3.1.0
hdfs==2.6.0
holster==2.0.0
httplib2==0.19.1
hypno==0.1.4
icecream==2.1.1
idna==2.6
imageio==2.10.4
importlib-metadata==4.8.2
importlib-resources==5.4.0
install==1.3.5
iotop==0.6
ipykernel==6.5.0
ipython==7.29.0
ipython-genutils==0.2.0
ipywidgets==7.6.5
jax==0.2.26
jaxlib==0.1.75+cuda11.cudnn82
jedi==0.18.0
Jinja2==3.0.3
jmespath==0.9.4
joblib==1.1.0
jsonschema==4.2.1
jupyter==1.0.0
jupyter-client==7.0.6
jupyter-console==6.4.0
jupyter-core==4.9.1
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.2
kaggle==1.5.12
keras==2.8.0
keras-nightly==2.9.0.dev2022011508
Keras-Preprocessing==1.1.2
keras-tuner==1.0.4
keyring==18.0.1
kiwisolver==1.3.2
kt-legacy==1.0.4
language-selector==0.1
launchpadlib==1.10.13
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
libclang==12.0.0
libcst==0.3.21
lime==0.2.0.1
llvmlite==0.37.0
lockfile==0.12.2
louis==3.12.0
macaroonbakery==1.3.1
madbg==1.2.0
Mako==1.1.0
Markdown==3.3.4
MarkupSafe==2.0.1
mat73==0.58
matplotlib==3.4.3
matplotlib-inline==0.1.3
mistune==0.8.4
ml-collections==0.1.0
monotonic==1.5
more-itertools==4.2.0
msgpack==1.0.3
multidict==5.2.0
mypy-extensions==0.4.3
nbclient==0.5.8
nbconvert==6.3.0
nbformat==5.1.3
nest-asyncio==1.5.1
netifaces==0.10.4
networkx==2.6.3
notebook==6.4.5
numba==0.54.1
numpy==1.22.1
oauth2client==4.1.3
oauthlib==3.1.0
olefile==0.46
opencv-python-headless==4.5.5.62
opt-einsum==3.3.0
optax==0.1.0
optuna==2.10.0
orjson==3.6.4
packaging==21.2
pandas==1.3.4
pandocfilters==1.5.0
paramiko==2.6.0
parso==0.8.2
pbr==5.7.0
pexpect==4.6.0
pickleshare==0.7.5
Pillow==7.0.0
pip==21.3.1
portalocker==2.3.2
prettytable==2.4.0
prometheus-client==0.12.0
promise==2.3
prompt-toolkit==3.0.22
proto-plus==1.19.8
protobuf==3.19.0
psutil==5.5.1
ptyprocess==0.7.0
py-cpuinfo==8.0.0
pyarrow==5.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycairo==1.16.2
pycocotools==2.0.4
pycparser==2.20
pycups==1.9.73
pycurl==7.43.0.2
pydot==1.4.2
Pygments==2.10.0
PyGObject==3.36.0
pyinjector==1.0.5
PyJWT==1.7.1
pymacaroons==0.13.0
pymongo==3.12.1
PyNaCl==1.3.0
pyOpenSSL==21.0.0
pyparsing==2.4.7
pyperclip==1.8.2
pyRFC3339==1.1
pyrsistent==0.18.0
PySimpleSOAP==1.16.2
python-apt==2.0.0+ubuntu0.20.4.7
python-dateutil==2.8.2
python-debian===0.1.36ubuntu1
python-debianbts==3.0.2
python-magic==0.4.16
python-slugify==5.0.2
pytz==2019.3
pyu2f==0.1.5
PyWavelets==1.2.0
pyxdg==0.26
PyYAML==5.3.1
pyzmq==22.3.0
qtconsole==5.2.0
QtPy==1.11.2
regex==2021.11.10
reportlab==3.5.34
requests==2.26.0
requests-oauthlib==1.3.0
requests-unixsocket==0.2.0
retry-decorator==1.1.1
roman==2.0.0
rsa==4.7.2
s3transfer==0.3.3
sacrebleu==2.0.0
scikit-image==0.18.3
scikit-learn==1.0.1
scipy==1.7.1
screen-resolution-extra==0.0.0
SecretStorage==2.3.1
Send2Trash==1.8.0
sentencepiece==0.1.96
seqeval==1.2.2
setuptools==45.2.0
shap==0.40.0
simplejson==3.16.0
six==1.15.0
slicer==0.0.7
SQLAlchemy==1.4.26
ssh-import-id==5.10
stevedore==3.5.0
systemd-python==234
tabulate==0.8.9
tensorboard==2.8.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
tensorflow==2.8.0
tensorflow-addons==0.15.0
tensorflow-cpu==2.7.0
tensorflow-datasets==4.4.0
tensorflow-estimator==2.7.0
tensorflow-gpu==2.7.0
tensorflow-hub==0.12.0
tensorflow-io-gcs-filesystem==0.23.1
tensorflow-metadata==1.4.0
tensorflow-model-optimization==0.7.0
tensorflow-probability==0.15.0
tensorflow-serving-api==2.7.0
termcolor==1.1.0
terminado==0.12.1
testpath==0.5.0
text-unidecode==1.3
tf-estimator-nightly==2.8.0.dev2021122109
tf-slim==1.1.0
tfx-bsl==1.4.0
threadpoolctl==3.0.0
tifffile==2021.11.2
toolz==0.11.2
tornado==6.1
tqdm==4.62.3
traitlets==5.1.1
typeguard==2.13.0
typing-extensions==3.7.4.3
typing-inspect==0.7.1
ubuntu-advantage-tools==27.6
ubuntu-drivers-common==0.0.0
ufw==0.36
unattended-upgrades==0.1
uritemplate==3.0.1
urllib3==1.22
usb-creator==0.3.7
virtualenv==20.0.17
wadllib==1.3.3
waymo-open-dataset-tf-2-6-0==1.4.1
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==0.44.0
Werkzeug==2.0.2
wheel==0.37.0
widgetsnbextension==3.5.2
wrapt==1.12.1
xkit==0.0.0
yarl==1.7.2
zipp==3.6.0
zope.event==4.5.0
zope.interface==5.4.0

Suggestion: Fix conflicting installations

Conflicting package installations found. Depending on the order of
installations and uninstallations, behavior may be undefined. Please
uninstall ALL versions of TensorFlow and TensorBoard, then reinstall
ONLY the desired version of TensorFlow, which will transitively pull
in the proper version of TensorBoard. (If you use TensorBoard without
TensorFlow, just reinstall the appropriate version of TensorBoard
directly.)

Namely:

pip uninstall tensorboard tensorflow tensorflow-estimator tensorflow-gpu tf-estimator-nightly
pip install tensorflow  # or `tensorflow-gpu`, or `tf-nightly`, ...
Next steps

Please try each suggestion enumerated above to determine whether it
solves your problem. If none of these suggestions works, 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. `
For browser-related issues, please additionally specify:

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

  • Version 99.0.4844.74 (Official Build) (64-bit)

  • Screenshot, if it’s a visual issue:
    image

Issue description

TF seems to not be able to print some of the bucket which is logged:
image
The errors are:
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed E0402 17:24:52.427664 140457068111616 _internal.py:225] Error on request: Traceback (most recent call last): File "/home/eran/.local/lib/python3.8/site-packages/werkzeug/serving.py", line 319, in run_wsgi execute(self.server.app) File "/home/eran/.local/lib/python3.8/site-packages/werkzeug/serving.py", line 308, in execute application_iter = app(environ, start_response) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/backend/application.py", line 525, in __call__ return self._app(environ, start_response) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/backend/application.py", line 566, in wrapper return wsgi_app(environ, start_response) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/backend/security_validator.py", line 77, in __call__ return self._application(environ, start_response_proxy) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/backend/path_prefix.py", line 68, in __call__ return self._application(environ, start_response) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/backend/experiment_id.py", line 73, in __call__ return self._application(environ, start_response) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/backend/empty_path_redirect.py", line 43, in __call__ return self._application(environ, start_response) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/backend/application.py", line 589, in wrapper return wsgi_app(environ, start_response) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/backend/application.py", line 548, in _route_request return self.exact_routes[clean_path](environ, start_response) File "/home/eran/.local/lib/python3.8/site-packages/werkzeug/wrappers/request.py", line 206, in application resp = f(*args[:-2] + (request,)) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/plugins/distribution/distributions_plugin.py", line 114, in distributions_route (body, mime_type) = self.distributions_impl( File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/plugins/distribution/distributions_plugin.py", line 87, in distributions_impl [self._compress(histogram) for histogram in histograms], File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/plugins/distribution/distributions_plugin.py", line 87, in <listcomp> [self._compress(histogram) for histogram in histograms], File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/plugins/distribution/distributions_plugin.py", line 93, in _compress converted_buckets = compressor.compress_histogram(buckets) File "/home/eran/.local/lib/python3.8/site-packages/tensorboard/plugins/distribution/compressor.py", line 108, in compress_histogram counts = buckets[:, 2]

Please describe the bug as clearly as possible. How can we reproduce the
problem without additional resources (including external data files and
proprietary Python modules)?
one can use the vit implementation in tensorflow/models, and try to log the training with tensorflow.
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir,write_images=True,embeddings_freq=1) print(model.summary()) model.fit(ds(samples, feature,2000), epochs=120, callbacks=[tensorboard_callback] )

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied diagnose_tensorboard.py output and the traceback around _internal.py:225, checking the reported TensorBoard, TensorFlow, NumPy, and conflicting-installation versions. Reproduce the bucket-logging failure and trace why a one-dimensional array receives two indices; done means the affected bucket renders without the IndexError.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python, tensorflow
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.