YaooXu / Q2T

Query2Triple: Unified Query Encoding for Answering Diverse Complex Queries over Knowledge Graphs. EMNLP 2023 finding
MIT License
6 stars 0 forks source link

File not found error:'data/NELL/stats.txt' #3

Closed nanxfu closed 7 months ago

nanxfu commented 7 months ago

I complete follow with README.md and use NELL dataset to test model.The step 1、2 conducted as expected the But when I follow with (3) Train TGT step, I was stucked by the error:

Traceback (most recent call last):
  File "I:\Development\Q2T\main.py", line 306, in <module>
    main(parse_args())
         ^^^^^^^^^^^^
  File "I:\Development\Q2T\args.py", line 89, in parse_args
    args = post_init_args(args)
           ^^^^^^^^^^^^^^^^^^^^
  File "I:\Development\Q2T\args.py", line 149, in post_init_args
    with open('%s/stats.txt' % args.data_path) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'data/NELL/stats.txt'

with command line( $kge_ckpt_path has been replaced with the real path produced by ssl-relation-prediction/main.py):

python main.py --cuda --do_train --do_valid --do_test  --data_path data/NELL --kge_ckpt_path $kge_ckpt_path -b 1024 -n 512 -de 2000 -dr 2000 -lr 0.0005 --label_smoothing 0.6 --cpu_num 5 --geo complex --num_hidden_layers 6 --num_attention_heads 12 --hidden_size 768 --intermediate_size 768 --token_embeddings 0 --hidden_dropout_prob 0.1 --warm_up_steps 20000 --max_steps 200000 --valid_steps 5000 --tasks 1p.2p.3p.2i.3i.ip.pi.2u.up.2in.3in.inp.pin.pni --prefix logs

` and I inspected the Q2T/data folder, the data folder structure(download from KGReasoning) is:

FB15k-237-betae
FB15k-237-q2b
FB15k-betae
FB15k-q2b
NELL-betae
NELL-q2b

obviously, there is no NELL/stats.txt file.So how to address this problem.

besides, there is a spelling error in Q2T/main.py LINE: 14 from your lastest commit. it should be :"from Models import Query2Triple" rather than models

Thanks for your anwser.

YaooXu commented 7 months ago

It should be --data_path data/NELL-betae, which will be corrected. In the latest codes, I rename Models to models, so you need to pull our latest codes.