luheng / lsgn

Labeled Span Graph Networks
Apache License 2.0
118 stars 27 forks source link

ValueError: '' is not a valid node name #12

Closed verosol closed 3 years ago

verosol commented 3 years ago

I am using the version for python3 (with tenserflow==1.14.0). I am trying to test the pre-trained model on the sample file, and being on the last stage with decoder.py I got this error:

Traceback (most recent call last): File "decoder.py", line 38, in model = SRLModel(data, config) File "/Users/nikahelicopter/Desktop/GERMANY/DR.SOLOPOVA/lsgn-python3/srl_model.py", line 24, in init self.data.input_dict, self.data.labels_dict) File "/Users/nikahelicopter/Desktop/GERMANY/DR.SOLOPOVA/lsgn-python3/srl_model.py", line 108, in get_predictions_and_loss max_sentence_length, sort_spans=False, enforce_non_crossing=False) File "/Users/nikahelicopter/Desktop/GERMANY/DR.SOLOPOVA/lsgn-python3/model_utils.py", line 212, in get_batch_topk sort_spans, enforce_non_crossing) # [num_sentences, max_num_predictions] File "", line 89, in extract_spans File "/Users/nikahelicopter/Library/Python/3.6/lib/python/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/Users/nikahelicopter/Library/Python/3.6/lib/python/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, kwargs) File "/Users/nikahelicopter/Library/Python/3.6/lib/python/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op op_def=op_def) File "/Users/nikahelicopter/Library/Python/3.6/lib/python/site-packages/tensorflow/python/framework/ops.py", line 1952, in init raise ValueError("'%s' is not a valid node name" % node_def.name) ValueError: '' is not a valid node name**

Can it have something to do with this comment? # TODO: Make labels_dict = None at test time. I have to change something as I use it in test mode?

I also wonder why in build_custom_kernels.sh for mac we use coref_kernels.so and with windows we build srl_kernels.so?

I really am looking forward to your answer, as my troubleshooting does not help much for now:( Thank you in advance!

Veronika

verosol commented 3 years ago

Just had to change

Mac

g++ -std=c++11 -shared srl_kernels.cc -o srl_kernels.so -I $TF_INC -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -undefined dynamic_lookup