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

Fix crash when running on CPU #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevenfontanella
Copy link

This commit fixes the following crash when running python run.py --input_files input.txt --segment on CPU:

THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=51 error=30 : unknown error
Traceback (most recent call last):
  File "run.py", line 48, in <module>
    segment(args)
  File "/home/steven/code/AIA/n/src/api.py", line 134, in segment
    model = AttnSegModel(args, word_vocab)
  File "/home/steven/code/AIA/n/src/elmo_crf_seg.py", line 18, in __init__
    self.elmo = ElmoEmbedder(cuda_device=0 if args.gpu is not None else -1)
  File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/elmo.py", line 166, in __init__
    self.elmo_bilm = self.elmo_bilm.cuda(device=cuda_device)
  File "/home/steven/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 260, in cuda
    return self._apply(lambda t: t.cuda(device))
  File "/home/steven/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 187, in _apply
    module._apply(fn)
  File "/home/steven/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 187, in _apply
    module._apply(fn)
  File "/home/steven/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
    param.data = fn(param.data)
  File "/home/steven/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 260, in <lambda>
    return self._apply(lambda t: t.cuda(device))
  File "/home/steven/.local/lib/python3.6/site-packages/torch/cuda/__init__.py", line 162, in _lazy_init
    torch._C._cuda_init()
RuntimeError: cuda runtime error (30) : unknown error at /pytorch/aten/src/THC/THCGeneral.cpp:51

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

Successfully merging this pull request may close these issues.

None yet

1 participant