Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnrecognizedFlagError!! #1

Open
yzho0907 opened this issue Apr 10, 2018 · 13 comments
Open

UnrecognizedFlagError!! #1

yzho0907 opened this issue Apr 10, 2018 · 13 comments

Comments

@yzho0907
Copy link

Traceback (most recent call last):
File "src/main.py", line 7, in
from inputs import util
File "/home/young/Downloads/fudan_mtl_reviews-master/src/inputs/util.py", line 50, in
def write_vocab(vocab, vocab_file=FLAGS.vocab_file):
File "/home/young/Downloads/ENTER/envs/deeplearning/lib/python3.5/site-packages/tensorflow/python/platform/flags.py", line 84, in getattr
wrapped(_sys.argv)
File "/home/young/Downloads/ENTER/envs/deeplearning/lib/python3.5/site-packages/absl/flags/_flagvalues.py", line 630, in call
name, value, suggestions=suggestions)
absl.flags._exceptions.UnrecognizedFlagError: Unknown command line flag 'build_data'

any idea how to fix it?

@wangzhihuia
Copy link

python src/main.py build_data

@yzho0907
Copy link
Author

thx, but missing embed300.trim.npy?

@wangzhihuia
Copy link

I am also trying to find solutions to solve this problem...

@yzho0907
Copy link
Author

is the embed300.trim.npy a word2vec?

@FrankWork
Copy link
Owner

FrankWork commented Apr 11, 2018

embed300.trim.npy is trimmed from google news word2vec. The origin file is too large, so I didn't upload it.

@FrankWork
Copy link
Owner

you can use --word_dim=50 to use pre-trained 50 dim senna embeddings

@yzho0907
Copy link
Author

yzho0907 commented Apr 11, 2018

thank u very much. i would like to try to change the data-set to a Chinese data-set, a lot of work to do!

@xiaoleihuang
Copy link

xiaoleihuang commented Apr 18, 2018

@wangzhihuia @FrankWork I tried the both commands below:

  1. python src/main.py build_data --word_dim=300;
  2. python src/main.py --word_dim=300 --build_data;

I still got the following error:
absl.flags._exceptions.UnrecognizedFlagError: Unknown command line flag 'word_dim'

Could you help me? Thank you!

Solved
Changed the settings in the main() codes:

  1. Change all 300 dims into 50
  2. Create two directories: saved_models in the project root folder; in data folder, create generated'; in the saved_modelsfolder createfudan-mtl-adv`

@linxiaoby
Copy link

I remove all the flags.DEFINE in util.py, and it works. Maybe it is because only one file can has flags?

@p-null
Copy link

p-null commented Dec 17, 2018

Hi, I tried every the method above. I still got the Unknown command line flag error.
Can someone provide a step-by-step procedure to run this program?

ps. I have also tried the exactly what author said in the readme but its not working.

@yzho0907
Copy link
Author

plz give the full error and Traceback

@chenting0324
Copy link

Hi, how can I use a Chinese data set? How to train the file "embed300.trim.npy"

@yzho0907
Copy link
Author

.npy file is actually a numpy type file, once u traind a 300d word embedding u can save it to a numpy type by using np.save() but more suggest that u use gensim.
Using Chinese data set i highly suggest u follow author's training data format and run the code. there is a another repo https://github.com/andyweizhao/capsule_text_classification gained a higher score.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants