Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[BART] Fail successfully when fairseq is not installed #4031

Open
klshuster opened this issue Sep 21, 2021 · 8 comments
Open

[BART] Fail successfully when fairseq is not installed #4031

klshuster opened this issue Sep 21, 2021 · 8 comments
Assignees
Labels
donotreap Avoid automatically marking as stale.

Comments

@klshuster
Copy link
Contributor

Bug description
When using BART models, or any models that require BART (e.g. some of the hallucination or BB2, several folks have posted that ParlAI fails with Could not find pretrained model in parlai.zoo.bart.bart_large or parlai.zoo.bart.build; we should, instead, raise an error and note that fairseq should be installed.

Related Issues:

Reproduction steps
See #3975 for repro.

Expected behavior
ParlAI should fail with an appropriate error, providing instructions for installing fairseq

Logs
See #3975 for logs.

@klshuster klshuster self-assigned this Sep 21, 2021
@github-actions
Copy link

This issue has not had activity in 30 days. Please feel free to reopen if you have more issues. You may apply the "never-stale" tag to prevent this from happening.

@github-actions github-actions bot added the stale label Oct 22, 2021
@klshuster klshuster added the donotreap Avoid automatically marking as stale. label Oct 22, 2021
@github-actions github-actions bot removed the stale label Oct 23, 2021
@avinashsai
Copy link
Contributor

Hi @klshuster I would like to work on this issue. Can you please more info where to add the error message.

@stephenroller
Copy link
Contributor

except (ImportError, AttributeError) as exc:

This except is catching too broadly an import error created by when we load the checkpoint here:

raise ModuleNotFoundError(

The easiest solution is to change the latter to a RunTimeError.

@avinashsai
Copy link
Contributor

Thank you! I will work on it.

@Guest400123064
Copy link

Guest400123064 commented Nov 5, 2022

Hi, I am not sure if I should put my question here. Basically, I installed ParlAI from source (v1.7.1) and installed Fairseq (v0.12.2) but I am still not able to run BB2 with the same error ModuleNotFoundError: No module named 'parlai.zoo.bart.bart_large', which is followed by File "/home/wangy49/Projects/empathic-bot/packages/ParlAI/parlai/core/torch_generator_agent.py", line 1599, in advance self.partial_hyps[path_selection.hypothesis_ids.long()], RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

When running parlai interactive -m bart, I only get the second error.

I cannot find any solution. I wonder if there could be any possible cause? Thank you very much in advance!

===========================================================================
EDITED: seems that torch v1.13 will cause this problem while torch 1.12 does not. But torch 1.12 gives a warning Unable to load ngram blocking on GPU: /home/wangy49/.cache/torch_extensions/py39_cu116/ngram_repeat_block_cuda/ngram_repeat_block_cuda.so: undefined symbol: _ZN8pybind116detail11type_casterIN2at6TensorEvE4loadENS_6handleEb

@klshuster
Copy link
Contributor Author

Thanks for flagging -- i would ignore the warning, if it's just that. If you could file a new issue regarding the first error, that would be great (so that we can track it separately)

@ye7iaserag
Copy link

I'm also having the indices should be either on cpu or on the same device error while converting bart.large after download
Using wsl2 with 3080 also have the same warning for the ngram blocks loading failure right before the failure of conversion

@klshuster
Copy link
Contributor Author

@ye7iaserag could you try downgrading to pytorch 1.12?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
donotreap Avoid automatically marking as stale.
Projects
None yet
Development

No branches or pull requests

5 participants