una-dinosauria / 3d-pose-baseline

A simple baseline for 3d human pose estimation in tensorflow. Presented at ICCV 17.
MIT License
1.42k stars 354 forks source link

AttributeError: module 'tensorflow' has no attribute 'app' #149

Closed andiconda closed 4 years ago

andiconda commented 5 years ago

Thanks for your interest in our research!

If you have problems running our code, please include

  1. Ubuntu18
  2. Tensorflow 2.0.0
  3. python 3.5
  4. The stack trace of the error that you see I meet the problem: Traceback (most recent call last): File "src/predict_3dpose.py", line 27, in tf.app.flags.DEFINE_float("learning_rate", 1e-3, "Learning rate") AttributeError: module 'tensorflow' has no attribute 'app'
ArashHosseini commented 5 years ago

Hi @andiconda, use this instead

tf.compat.v1.app.run(
    main=None,
    argv=None
)

let it me know if its not working

jieluyan commented 5 years ago

I have the same question, but what do you mean? @ArashHosseini , shall we add: tf.compat.v1.app.run( main=None, argv=None ) to the front of the error line "tf.app.flags.DEFINE_float("learning_rate", 1e-3, "Learning rate")"?

ArashHosseini commented 5 years ago

i am only following the documentation, check docu and Tf 1 to 2 migration docu To get TF 1.x like behaviour in TF 2.0 one can run

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()