dennybritz / cnn-text-classification-tf

Convolutional Neural Network for Text Classification in Tensorflow
Apache License 2.0
5.64k stars 2.77k forks source link

solve `error to parse FLAGS` #127 #137

Closed anarkia7115 closed 6 years ago

anarkia7115 commented 6 years ago

This pull request mainly try to solve #127

  1. Commented FLAGS._parse_flags(), tf.flags.FLAGS have no _parse_flags function in 1.5.0.
  2. Moved 'Data Preparation' part to 'preprocess' function, moved 'Training' part to 'train' function.
  3. Added 'main' function.
  4. Added tf.app.run() at the last part of code.
wuyongdec commented 6 years ago

tensorflow 1.8.0
works!

dennybritz commented 6 years ago

Thanks!

Kyle-MacKinnon commented 6 years ago

I have tensorflow 1.8.0 but still get this error.

PS C:\Users\kkmac\Desktop\Spam or Ham\cnn-text-classification-tf> python ./eval.py --eval_train --checkpoint_dir="./runs /1526268435/checkpoints" Traceback (most recent call last): File "./eval.py", line 31, in <module> FLAGS._parse_flags() File "C:\Users\kkmac\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\flags.py", line 85, in __getattr__ return wrapped.__getattr__(name) File "C:\Users\kkmac\AppData\Local\Programs\Python\Python36\lib\site-packages\absl\flags\_flagvalues.py", line 470, in __getattr__ raise AttributeError(name) AttributeError: _parse_flags

Nadedic commented 6 years ago

Same problem like Kyle here, apparently this tensorflow has changed or one pull request changed something else. I mean training works until I manually stop it but the problem with evaluation. How exactly are we gonna ignore flag.parse() function?!