tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.58k stars 3.51k forks source link

Workaround for AttributeError: module 'tensorflow' has no attribute 'logging' ? #1887

Closed j1141 closed 3 years ago

j1141 commented 3 years ago

Description

SOLUTION: see https://github.com/tensorflow/tensor2tensor/issues/1849 Installing it directly from git and then changing the files in which the code still wasn't adapted (import tensorflow.compat.v1 as tf) fixed the issue.

When trying to use the t2t-decoder on a transformer model, I get the following error: Traceback (most recent call last): File "/usr/local/bin/t2t-decoder", line 16, in tf.logging.set_verbosity(tf.logging.INFO) AttributeError: module 'tensorflow' has no attribute 'logging'

I know T2T is not supposed to be compatible with TF2+, but what I dont understand why only decoder is throwing out this error? I was able to get the data and train my model without any problems using TF2.4.

Is there any reason why this particular code gets this error? And is there a way to disable it/modify it?