Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while using generate.py #9

Open
smita181298 opened this issue Oct 10, 2020 · 1 comment
Open

Error while using generate.py #9

smita181298 opened this issue Oct 10, 2020 · 1 comment

Comments

@smita181298
Copy link

Hello, @armancohan @kyleclo @isabelcachola
I am trying to generate a summary from this command given in the repo.
!python generate.py model/ data_input/ out/ --checkpoint_file checkpoint_best.pt --beam 2 --lenpen 0.4 --test_fname test.hypo
Here model is the folder containing checkpoint given for summarization( bart.tldr-aic)
data_input contains test.source file which is a text file containing the source content of the test.jsonl file of scitldr/SciTLDR-Data/SciTLDR-AIC/
out is an empty folder to store the output.

I am getting this error.

Traceback (most recent call last):
File "generate.py", line 100, in
generate_TLDRs(**vars(args))
File "generate.py", line 17, in generate_TLDRs
task='translation'
File "/content/gdrive/My Drive/Internship_SPI_Smita/Scientific_paper_summarization/scitldr/fairseq/fairseq/models/bart/model.py", line 112, in from_pretrained
**kwargs,
File "/content/gdrive/My Drive/Internship_SPI_Smita/Scientific_paper_summarization/scitldr/fairseq/fairseq/hub_utils.py", line 73, in from_pretrained
arg_overrides=kwargs,
File "/content/gdrive/My Drive/Internship_SPI_Smita/Scientific_paper_summarization/scitldr/fairseq/fairseq/checkpoint_utils.py", line 243, in load_model_ensemble_and_task
task = tasks.setup_task(args)
File "/content/gdrive/My Drive/Internship_SPI_Smita/Scientific_paper_summarization/scitldr/fairseq/fairseq/tasks/init.py", line 27, in setup_task
return TASK_REGISTRY[task_cfg.task].setup_task(task_cfg, **kwargs)
File "/content/gdrive/My Drive/Internship_SPI_Smita/Scientific_paper_summarization/scitldr/fairseq/fairseq/tasks/translation.py", line 226, in setup_task
paths = utils.split_paths(args.data)
File "/content/gdrive/My Drive/Internship_SPI_Smita/Scientific_paper_summarization/scitldr/fairseq/fairseq/utils.py", line 59, in split_paths
if "://" not in paths
TypeError: argument of type 'NoneType' is not iterable

Please help me on how to solve this.

@anshoomehra
Copy link

anshoomehra commented Jan 6, 2021

@smita181298 you are a step ahead, I am having a hard time generating data files, getting the below error for "AIC":

  • Were you able to resolve the error you are getting?
  • Would you be able to share your work as a Docker Container? I am guessing some mismatch of library versions stalling me, perhaps I can start from what you have accomplished?

FileNotFoundError: [Errno 2] No such file or directory: 'encoder.json'
Process ForkPoolWorker-73260:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.6/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "/jupyter_mount/scitldr/SciTLDR-Data/multiprocessing_bpe_encoder.py", line 96, in initializer
bpe = get_encoder(self.args.encoder_json, self.args.vocab_bpe)
File "/usr/local/lib/python3.6/dist-packages/fairseq/data/encoders/gpt2_bpe_utils.py", line 132, in get_encoder
with open(encoder_json_path, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'encoder.json'
Process ForkPoolWorker-73261:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.6/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "/jupyter_mount/scitldr/SciTLDR-Data/multiprocessing_bpe_encoder.py", line 96, in initializer
bpe = get_encoder(self.args.encoder_json, self.args.vocab_bpe)
File "/usr/local/lib/python3.6/dist-packages/fairseq/data/encoders/gpt2_bpe_utils.py", line 132, in get_encoder
with open(encoder_json_path, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'encoder.json'
Process ForkPoolWorker-73262:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.6/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "/jupyter_mount/scitldr/SciTLDR-Data/multiprocessing_bpe_encoder.py", line 96, in initializer
bpe = get_encoder(self.args.encoder_json, self.args.vocab_bpe)
File "/usr/local/lib/python3.6/dist-packages/fairseq/data/encoders/gpt2_bpe_utils.py", line 132, in get_encoder
with open(encoder_json_path, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'encoder.json'
Process ForkPoolWorker-73263:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.6/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "/jupyter_mount/scitldr/SciTLDR-Data/multiprocessing_bpe_encoder.py", line 96, in initializer
bpe = get_encoder(self.args.encoder_json, self.args.vocab_bpe)
File "/usr/local/lib/python3.6/dist-packages/fairseq/data/encoders/gpt2_bpe_utils.py", line 132, in get_encoder
with open(encoder_json_path, "r") as f:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants