Closed yanghoonkim closed 5 years ago
@yanghoonkim Have you solved decoder problem?
For me, I encountered another bug:
(tensorflow) jinyang@ubuntu1604:/data1/caozhen/MPQG/src$ python NP2P_beam_decoder.py --model_prefix /data1/caozhen/MPQG/src/logs/NP2P.mpqg_5 --in_path /data1/caozhen/MPQG/src/data/test_sent_pre.json --out-path /data1/caozhen/MPQG/logs/predictions.txt --mode beam CUDA_VISIBLE_DEVICES 0,1,2,3,4,5,6 Loading configurations from /data1/caozhen/MPQG/src/logs/NP2P.mpqg_5.config.json Loading vocabs. word_vocab: (69980, 300) POS_vocab: (46, 20) Loading test set. Number of samples: 11805 Build DataStream ... Number of instances in testDataStream: 11805 Number of batches in testDataStream: 237 2018-11-28 13:44:11.263634: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA Traceback (most recent call last): File "NP2P_beam_decoder.py", line 342, in
outfile = open(out_path, 'wt') TypeError: coercing to Unicode: need string or buffer, NoneType found
@freesunshine0316 and I find a solution here https://stackoverflow.com/questions/16169035/coercing-to-unicode-need-string-or-buffer-nonetype-found-when-rendering-in-dja but I don't know how to modify the code since I am sitll not familiar with your code. Can you take a look? Thx!
@yanghoonkim I met the same, Have you solved decoder problem?
@caozhen-alex @KJ-Lin I didn't, but you guys can try greedy decoding(it works). I think there are some error with related to beam search.
@yanghoonkim U mean using the file generator_utils.py
to generate?
@yanghoonkim @caozhen-alex I have find the problem the code is "if mode in ['beam_search', 'beam_evaluate']: batch_size = 1 " so it can be work "python NP2P_beam_decoder.py --model_prefix ~/MPQG/src/logs/NP2P.mpqg_1 --in_path ~/MPQG/src/data/test_sent_pre.json --out-path ~/MPQG/predictions.txt --mode beam_search" change the run mode to "beam_search" or change the above code 'beam_search' to 'beam'
--out-path
Hi, You used the wrong flag, it should be " --out_path"
I updated the code to have the "required" restriction for input parameters. Previously, the code asks for "--out_path", while it was feed "--out-path". So it didn't get what it wants and the "out_path" variable is None.
With command:
I got an error message:
There may be some inconsistency related to batch size?
Or did I do something wrong?
I didn't change any of
config.json