dennybritz / cnn-text-classification-tf

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

AttributeError: _parse_flags #158

Closed CarbuncleOrigin closed 6 years ago

CarbuncleOrigin commented 6 years ago

I've finished running train.py but when i run eval.py i get this error. Can you help me with this? Traceback (most recent call last): File "./eval.py", line 31, in FLAGS._parse_flags() File "C:\Users\Admin\Anaconda3\lib\site-packages\tensorflow\python\platform\flags.py", line 85, in getattr return wrapped.getattr(name) File "C:\Users\Admin\Anaconda3\lib\site-packages\absl\flags_flagvalues.py", line 470, in getattr raise AttributeError(name) AttributeError: _parse_flags

Hind-Almerekhi commented 6 years ago

Hi, I had the same issue and managed to solve it by doing the following: replace FLAGS._parse_flags() with import sys FLAGS(sys.argv)

Then run the eval.py script as instructed by the readme file.

Hope it helps!

CarbuncleOrigin commented 6 years ago

thanks

usmaann commented 6 years ago

Hi where to replace below files

replace FLAGS._parse_flags() with import sys FLAGS(sys.argv

Hind-Almerekhi commented 6 years ago

Hello You don't need to replace any files, just replace this line of code in the file eval.py: FLAGS._parse_flags()

with the following lines: import sys FLAGS(sys.argv)

Then you should be able to run the eval.py code with no problems.

I hope it's clear now.