ailab-prompt-transfer / TextBox

Implement of PTG
https://github.com/RUCAIBox/TextBox
MIT License
0 stars 0 forks source link

ValueError: Path does n\/ROUGE-1.5.5.pl #4

Closed ssoyaavv closed 1 year ago

ssoyaavv commented 1 year ago

2, 3번 실험 중 오류 발생

실행 명령어 accelerate launch run_textbox.py --model=PTG --dataset=cnndm --model_path=facebook/bart-large --gpu_id=0,1 --find_unused_parameters=true

error log 17 Jul 15:22 ERROR Traceback (most recent call last): File "/workspace/TextBox/textbox/utils/dashboard.py", line 327, in new_experiment yield True File "/workspace/TextBox/textbox/quick_start/experiment.py", line 143, in run self._do_train_and_valid() File "/workspace/TextBox/textbox/quick_start/experiment.py", line 118, in _do_train_and_valid self.valid_result = self.trainer.fit(train_data, valid_data) File "/workspace/TextBox/textbox/trainer/trainer.py", line 460, in fit self.stopped |= self._valid(valid_data, 'epoch') File "/opt/conda/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, *kwargs) File "/workspace/TextBox/textbox/trainer/trainer.py", line 298, in _valid valid_results = self.evaluate(valid_data, is_valid=True) File "/opt/conda/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(args, **kwargs) File "/workspace/TextBox/textbox/trainer/trainer.py", line 572, in evaluate result = self.evaluator.evaluate(generate_corpus, reference_dataset) File "/workspace/TextBox/textbox/evaluator/base_evaluator.py", line 157, in evaluate metric_result = evaluator.evaluate(generate_corpus, reference_corpus, avg=avg) File "/workspace/TextBox/textbox/evaluator/abstract_evaluator.py", line 31, in evaluate metric_dict = self._calc_metrics_info(generate_corpus=generate_corpus, reference_corpus=reference_corpus) File "/workspace/TextBox/textbox/evaluator/rouge_evaluator.py", line 48, in _calc_metrics_info s._load() File "/opt/conda/lib/python3.8/site-packages/files2rouge-2.1.0-py3.8.egg/files2rouge/settings.py", line 22, in _load self.set_data(data) File "/opt/conda/lib/python3.8/site-packages/files2rouge-2.1.0-py3.8.egg/files2rouge/settings.py", line 44, in set_data raise ValueError("Path does not exist %s" % path) ValueError: Path does n\/ROUGE-1.5.5.pl

ssoyaavv commented 1 year ago

해결 방안 https://github.com/RUCAIBox/TextBox/blob/0d7debd9817c0f0278a52506e41ac2677d567550/README.md?plain=1#L47

minji-o-j commented 1 year ago

Textbox/install.sh 파일 대로 수행

1

pip install -U git+https://github.com/pltrdy/pyrouge.git git clone https://github.com/pltrdy/files2rouge.git

2

cd files2rouge

setup_rouge.py 💥여기서 22번째줄 변경

  # default_root = os.path.join(home, '.files2rouge/')
  default_root= os.path.join("/workspace/", '.files2rouge/') #os.path.join([경로], '.files2rouge/')  # 디렉터리 앞뒤로 / 써줘야함

하단 실행 python setup_rouge.py python setup.py install

3

pip uninstall py-rouge pip install rouge