zackhy / TextClassification

Text classification using different neural networks (CNN, LSTM, Bi-LSTM, C-LSTM).
MIT License
194 stars 60 forks source link

invalid file:<absl.flags._flag.Flag object at 0x0000000011E2E898> #3

Closed purohitvivek8 closed 6 years ago

purohitvivek8 commented 6 years ago

Hello @zackhy when I run following command python test.py --test_data_file=./data/data.csv --run_dir=./runs/1111111111 --clf=clf-10000 I got this error->unrecognizedflagerror:Unknown command line flag 'clf' SO I just add following line tf.flags.DEFINE_string('clf', 'cnn', "Type of classifiers. Default: cnn. You have four choices: [cnn, lstm, blstm, clstm]") in test.py

purohitvivek8 commented 6 years ago

After adding clf flag and execute following command python test.py --test_data_file=./data/data.csv --run_dir=./runs/1111111111 --clf=clf-10000

Its give error-> data_helper line 38 in load data data_helper.py line 149 in _stop_words invalid file:<absl.flags._flag.Flag object at 0x0000000011E2E898>

zackhy commented 6 years ago

@purohitvivek8 Oh I made a mistake in the README file.......Actually it should be --checkpoint=clf-100. You don't need to add the tf.flags.DEFINE_string('clf', 'cnn', "Type of classifiers. Default: cnn. You have four choices: [cnn, lstm, blstm, clstm]") in test.py.

zackhy commented 6 years ago

@purohitvivek8 And for the second error, I don't know where it comes from. Maybe you could try to run the test.py with --checkpoint=clf-xxxx and see if the error still exists. And sorry for the confusion.

purohitvivek8 commented 6 years ago

@zackhy still same error data_helper line 38 in load data data_helper.py line 149 in _stop_words invalid file:<absl.flags._flag.Flag object at 0x0000000011E2E898>

zackhy commented 6 years ago

@purohitvivek8 emmm...everything works fine on my computer. So do you have a stop word file? If not, try assigning the sw_path at line 33 to None and see if this works.

zackhy commented 6 years ago

@purohitvivek8 And also you are not using the command "python test.py --test_data_file=./data/data.csv --run_dir=./runs/1111111111 --checkpoint=clf-10000", right? This command line is just an example, you should change the values of the parameters according to the files generated by train.py.

purohitvivek8 commented 6 years ago

Yes @zackhy I Know its example,I am doing according to my PC's directory

purohitvivek8 commented 6 years ago

I don't have stop word file

purohitvivek8 commented 6 years ago

Yes after change sw_path at line 33 to None Now its Working,Thanks