dalab / web2text

Source code for the paper "Web2Text: Deep Structured Boilerplate Removal", full paper @ ECIR'18
MIT License
168 stars 31 forks source link

KeyError: '__flags' #4

Closed ghost closed 6 years ago

ghost commented 6 years ago

I did these steps:

  1. Set the CHECKPOINT_DIR variable in main.py.
  2. Make sure the files block_features.csv and edge_features.csv are in the src/main/python/data directory. Use the example from the previous section for this.
  3. Convert the CSV files to .npy with data/convert_scala_csv.py.
  4. Train the unary CNN with python3 main.py train_unary.

but, the fourth step failed with this error:

  File "main.py", line 262, in <module>
    main()
  File "main.py", line 28, in main
    train_unary()
  File "main.py", line 83, in train_unary
    dropout_keep_prob=DROPOUT_KEEP_PROB)
  File "/root/work/web2text/src/main/python/forward.py", line 19, in unary
    c = Config()
  File "/root/work/web2text/src/main/python/config.py", line 12, in __init__
    for k, v in iteritems(FLAGS.__dict__['__flags']):
KeyError: '__flags'

Could you tell me how to fix it?

My tensorflow version is 1.10.0

tvogels commented 6 years ago

This seems to be an incompatibility with more modern Tensorflow versions (the code was written for Tensorflow 1.4 or so)

The commit above should fix this.

ghost commented 6 years ago

Another error happened.

KeyError: b'data'

so I replaced all b' to ' and it seemed to work correctly.

Maybe, it's related to numpy version but I'm not sure. (my numpy version is 1.14.3)

Anyway, thanks so much!