arahusky / diacritics_restoration

Neural based model for automatic diacritics restoration.
24 stars 4 forks source link

infer.py error #1

Closed chnga closed 5 years ago

chnga commented 5 years ago

Dear author, After build and save model, I run python3 infer.py undiacritized_text.txt diacritized_text.txt save/model/timestamp/ The error as following:

tensorflow.python.framework.errors_impl.UnimplementedError: TensorArray has size zero, but element shape [?,200] is not fully defined. Currently only static shapes are supported when packing zero-size TensorArrays. [[{{node rnn_cell0/bidirectional_rnn/fw/fw/TensorArrayStack/TensorArrayGatherV3}} = TensorArrayGatherV3[dtype=DT_FLOAT, element_shape=[?,200], _device="/job:localhost/replica:0/task:0/device:GPU:0"](rnn_cell0/bidirectional_rnn/fw/fw/TensorArray, rnn_cell0/bidirectional_rnn/fw/fw/TensorArrayStack/range, rnn_cell0/bidirectional_rnn/fw/fw/while/Exit_2)]] [[{{node Softmax/_127}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_428_Softmax", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/pycharm-community-2018.2.3/helpers/pydev/pydevd.py", line 1664, in main() File "/pycharm-community-2018.2.3/helpers/pydev/pydevd.py", line 1658, in main globals = debugger.run(setup['file'], None, None, is_module) File "/pycharm-community-2018.2.3/helpers/pydev/pydevd.py", line 1068, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/pycharm-community-2018.2.3/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/diacritics/infer.py", line 79, in corrected_sentences = infer(source_file, exp_dir, lm, beam_size, args.alpha) File "/diacritics/infer.py", line 55, in infer corrected_sentences = bsd(infer_model.session, sentences) File "/diacritics/beam_search_decoder.py", line 166, in call outputs_softmax = sess.run(self.c2c_model.outputs_softmax, feed_dict=feed)