wenhuchen / LogicNLG

The data and code for ACL2020 paper "Logical Natural Language Generation from Open-Domain Tables"
MIT License
166 stars 22 forks source link

FileNotFoundError while running parse_programs #17

Open velocityCavalry opened 1 year ago

velocityCavalry commented 1 year ago

Hi,

Thank you for making the code public! I was running parse_programs.py with my own output file, but encountered the error below. Has anyone encountered the same problem?

Thanks!

python parse_programs.py --parse --score_file /private/home/velocityyu/Data2TextReasoning/baselines/seed=42_k=2_temp=0.7_samples=random.jsonl.json
Using 80 cores to run on 848 instances
/private/home/velocityyu/LogicNLG/APIs.py:370: UserWarning: This pattern is interpreted as a regular expression, and has match groups. To actually get the groups, use str.extract.
  returned = t[t[col].str.contains(reg_val, regex=True, na=False)]
/private/home/velocityyu/LogicNLG/APIs.py:370: UserWarning: This pattern is interpreted as a regular expression, and has match groups. To actually get the groups, use str.extract.
  returned = t[t[col].str.contains(reg_val, regex=True, na=False)]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/private/home/velocityyu/miniconda3/envs/d2t/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/private/home/velocityyu/miniconda3/envs/d2t/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/private/home/velocityyu/LogicNLG/parser.py", line 1859, in distribute_parse
    with open('tmp/results/{}.json'.format(hash_id), 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/results/039c33c346de34e6.json'

Similar issue also happens when running with the provided files in outputs:

python parse_programs.py --parse --score_file outputs/GPT_gpt2_12.65.json

/private/home/velocityyu/LogicNLG/APIs.py:370: UserWarning: This pattern is interpreted as a regular expression, and has match groups. To actually get the groups, use str.extract.
  returned = t[t[col].str.contains(reg_val, regex=True, na=False)]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/private/home/velocityyu/miniconda3/envs/d2t/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/private/home/velocityyu/miniconda3/envs/d2t/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/private/home/velocityyu/LogicNLG/parser.py", line 1859, in distribute_parse
    with open('tmp/results/{}.json'.format(hash_id), 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/results/351e236e88730f80.json'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "parse_programs.py", line 467, in <module>
    results = pool.map(parser.distribute_parse, zip(table_names, sents))
  File "/private/home/velocityyu/miniconda3/envs/d2t/lib/python3.8/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/private/home/velocityyu/miniconda3/envs/d2t/lib/python3.8/multiprocessing/pool.py", line 768, in get
    raise self._value
FileNotFoundError: [Errno 2] No such file or directory: 'tmp/results/351e236e88730f80.json'