Skip to content
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

Make tensorflow optional when using tensorboard #1879

Merged
merged 6 commits into from
Jul 3, 2023
Merged

Conversation

charlesbvll
Copy link
Member

@charlesbvll charlesbvll commented May 17, 2023

Issue

Description

Currently when using tensorboard, the app will crash in an unhelpful way if tensorflow is not installed.

Related issues/PRs

N/A

Proposal

Explanation

If tensorflow is not installed we display a warning to the user, and instead use the regular strategy that was passed to the wrapper so the execution can continue.

Checklist

  • Implement proposed change
  • Make CI checks pass
  • Ping maintainers on Slack (channel #contributions)

Any other comments?

N/A

@jafermarq
Copy link
Contributor

jafermarq commented Jun 27, 2023

afaik tenforflow is not needed to be installed to use Tensorboard. On a clean env i can do just pip install tensorboard and the following will work just fine:

import tensorboard as tb
w = tb.summary.Writer('test') # creates dir `test` in current path
w.add_scalar(data=0.99, tag='meh', step=0)
w.add_scalar(data=1.99, tag='meh', step=1)
w.flush()
w.close()
quit()

Then i can launch the dashboard and see the two datapoints: tensorboard --logdir test

Maybe some functionalities do indeed require support from TF? (or PyTorch, which also can interface w/ Tensorboard)?

@charlesbvll
Copy link
Member Author

@jafermarq We actually don't use Tensorboard directly in the code, we only use tensorflow.summary , hence why I was doing the check on Tensorflow. Maybe the code could be rewritten without tensorflow, but I'm not sure...

@charlesbvll charlesbvll marked this pull request as ready for review June 28, 2023 09:16
@danieljanes danieljanes merged commit a0bea73 into main Jul 3, 2023
@danieljanes danieljanes deleted the handle-missing-tf branch July 3, 2023 19:12
tanertopal added a commit that referenced this pull request Jul 5, 2023
* main:
  Remove line with typo from script (#2001)
  Fix simulation error caused by Pydantic version in Ray (#2002)
  Update mxnet examples dependency versions (#1982)
  Update torch version in pyproject.toml files (#1993)
  Update tensorflow examples dependency versions (#1984)
  Fix the baseline template docstrings (#1983)
  Fix Baselines CI PyLint error by using Resampling (#1998)
  Make tensorflow optional when using tensorboard (#1879)
  Update dependencies for MXNet example (#1988)
  Fix `starlette` vulnerability (#1992)
  Fix vulnerability detected by Dependabot (#1990)
  Fix dependabot critical errors (#1989)
  Add Ruff UP check (#1946)
  Update torch examples dependency versions (#1981)
  Remove && from the end of lines in test.sh (#1979)
  Baselines docs updates (#1977)
  Fixes GitHub CI issue because of behaviour change (#1976)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants