Fixed AttributeError to get io from tf - #6135
Conversation
Fixed Error:
AttributeError: module 'tensorflow' has no attribute 'io'
since:
from tensorboard.compat import tf == tensorflow
which gives AttributeError: module 'tensorflow' has no attribute 'io'
but we need:
from tensorboard.compat import tensorflow_stub as tf
now 'io' can be imported from tensorflow_stub
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Hi, thanks for your interest in contributing. Can you please provide more detail about how this bug is triggered, with all the information we would need to reproduce the issue? A good way to do this might be to first open an issue and fill out our issue template (including the environment-specific information collected by the script), so we can better understand the bug you're fixing, prior to sending the PR. |
|
Sorry, next time, I will definitely open a issue first. Python Code: import traceback
from torch.utils.tensorboard import SummaryWriter
from tensorboard.summary.writer.event_file_writer import EventFileWriter
if __name__ == '__main__':
print()
print("EventFileWriter:")
print()
try:
EventFileWriter("C:/X")
except Exception as e:
print(traceback.format_exc())
print()
print("SummaryWriter:")
print()
try:
SummaryWriter(log_dir="C:/X")
except Exception as e:
print(traceback.format_exc())Error: Version: > pip list | findstr "tensor"
tensorboard 2.11.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow 2.11.0
tensorflow-estimator 2.11.0
tensorflow-intel 2.11.0
tensorflow-io 0.29.0
tensorflow-io-gcs-filesystem 0.29.0 |
|
Sorry, with additional testing I figured out this only happens when pytorch is installed as well. I will report the bug to pytorch then. |
Fixed Error:
Line 72 and 86: AttributeError: module 'tensorflow' has no attribute 'io'
since:
from tensorboard.compat import tf == tensorflow
which gives AttributeError: module 'tensorflow' has no attribute 'io'
but we need:
from tensorboard.compat import tensorflow_stub as tf
now 'io' can be imported from tensorflow_stub