Compatibility with tensorflow 2.0
See original GitHub issuewandb --version && python --version && uname
- Weights and Biases version: 0.8.16
- Python version: 3.7.4
- Operating System: Win 10
Description
I try to log my custom losses using tensorboard. It seems wandb isn’t compatible with the @tf.function decorator, and it would mean that using wandb would slow down the code considerably. Is tf.function supported ?
What I Did
@tf.function
def train_on_batch(self, obs1, obs2, act, rew, done, step):
[...]
wandb.tensorflow.log('losses/q1_loss', q1_loss, step=step)
Error: TypeError: To be compatible with tf.contrib.eager.defun, Python functions must return zero or more Tensors; in compilation of <function create_converted_entity_factory.<locals>.create_converted_entity.<locals>.tf__log.<locals>.<lambda> at 0x000001D386C6B288>, found return value of type <class ‘wandb.history.History’>, which is not a Tensor.
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
TensorFlow version compatibility
TensorFlow 1.2 might support GraphDef versions 4 to 7. · TensorFlow 1.3 could add GraphDef version 8 and support versions 4 to 8....
Read more >Install TensorFlow 2
Learn how to install TensorFlow on your system. Download a pip package, run in a Docker container, or build from source.
Read more >Effective Tensorflow 2 | TensorFlow Core
This guide provides a list of best practices for writing code using TensorFlow 2 (TF2), it is written for users who have recently...
Read more >Module: tf.compat | TensorFlow v2.11.0
The tf.compat module contains two sets of compatibility functions. Tensorflow 1.x and 2.x APIs. The compat.
Read more >TensorFlow 1.x vs TensorFlow 2 - Behaviors and APIs
To be TF2 compatible, your code must be compatible with the full set of TF2 behaviors. During migration, you can enable or disable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Danmou, the branch should be fixed now, there was an issue how the “pip install …#egg=wandb” command was messing with the python environment.
Please try the:
pip install --upgrade git+git://github.com/wandb/client.git@fix/tensorboard-import-issue#egg=wandb
command again. you might want topip uninstall wandb
first just to make sure it grabs a new version.I had the same issue when using TF and TensorBoard from the global site packages. When I switched to a venv on the machine it worked though.