krasserm / fairseq-image-captioning

Transformer-based image captioning extension for pytorch/fairseq
Apache License 2.0
316 stars 56 forks source link

FileNotFound Error in demo #27

Open Haochen-Luo opened 3 years ago

Haochen-Luo commented 3 years ago

Hi, Krasser

When I run the demo script in colab I got the following error. Could you help me with this issue? I have installed all the packages required. Thanks a lot.

!python generate.py \
--user-dir task \
--features obj \
--tokenizer moses \
--bpe subword_nmt \
--bpe-codes output/codes.txt \
--beam 5 \
--split test \
--path /content/drive/MyDrive/checkpoint24.pt \
--input demo/demo-ids.txt \
--output demo/demo-predictions.json
Namespace(no_console_output=False, output='demo/demo-predictions.json', split='test') ['--user-dir', 'task', '--features', 'obj', '--tokenizer', 'moses', '--bpe', 'subword_nmt', '--bpe-codes', 'output/codes.txt', '--beam', '5', '--path', '/content/drive/MyDrive/checkpoint24.pt', '--input', 'demo/demo-ids.txt']
Traceback (most recent call last):
  File "generate.py", line 145, in <module>
    cli_main()
  File "generate.py", line 128, in cli_main
    parser = options.get_generation_parser(interactive=True, default_task='captioning')
  File "/usr/local/lib/python3.7/dist-packages/fairseq/options.py", line 44, in get_generation_parser
    parser = get_parser("Generation", default_task)
  File "/usr/local/lib/python3.7/dist-packages/fairseq/options.py", line 210, in get_parser
    utils.import_user_module(usr_args)
  File "/usr/local/lib/python3.7/dist-packages/fairseq/utils.py", line 446, in import_user_module
    raise FileNotFoundError(module_path)
FileNotFoundError: /content/fairseq-image-captioning/task