The environment is TensorFlow2.9
The code to be run on github The TensorFlow environment is 1.x
Many apis cannot be called
Original code
train_summary_op = tf.summary.merge([loss_summary])
Error reporting in method 1
train_summary_op = tf.compat.v1.summary.merge([loss_summary])
display
TypeError: Tensors in list passed to 'inputs' of 'MergeSummary' Op have types [bool] that do not match expected type string.
If it can’t be solved, I will try
import tensorflow as tf
Modified as
import tensorflow._api.v2.compat.v1 as tf
tf.disable_v2_behavior()
Finally, solve the problem successfully
Read More:
- [Solved] Pytorch call tensorboard error: AttributeError: module ‘tensorflow’ has no attribute ‘gfile’
- [Solved] Error: AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
- Python AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘
- [Solved] AttributeError: module ‘tensorflow._api.v2.train‘ has no attribute ‘AdampOptimizer‘
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- [Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- [Perfectly Solved] attributeerror: module ‘SciPy. Misc’ has no attribute ‘toimage’ error
- [Solved] AttributeError: module ‘pandas‘ has no attribute ‘rolling_count‘
- [Solved] AttributeError: module ‘PIL.Image‘ has no attribute ‘open‘
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘stats’
- [Solved] AttributeError: module ‘time‘ has no attribute ‘clock‘
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [Solved] AttributeError: module ‘distutils‘ has no attribute ‘version‘
- [Solved]AttributeError: module ‘urllib’ has no attribute ‘quote’
- [Solved] AttributeError: partially initialized module ‘xlwings’ has no attribute ‘App’
- [Solved] AttributeError: module ‘setuptools._distutils‘ has no attribute ‘version‘
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘