zzzDavid / ICDAR-2019-SROIE

ICDAR 2019 Robust Reading Challenge on Scanned Receipts OCR and Information Extraction
MIT License
385 stars 132 forks source link

AssertionError: Torch not compiled with CUDA enabled in task 3/src/train.py #4

Open anitchakraborty opened 4 years ago

anitchakraborty commented 4 years ago

While training the model via train.py file in the task 3/src/train.py, the following error is popping up, any assistance shall be immensely helpful.

[Traceback (most recent call last):
  File "./src/train.py", line 75, in <module>
    main()
  File "./src/train.py", line 21, in main
    model = MyModel0(len(VOCAB), 20, args.hidden_size).to(args.device)
  File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 426, in to
    return self._apply(convert)
  File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 202, in _apply
    module._apply(fn)
  File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 224, in _apply
    param_applied = fn(param)
  File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 424, in convert
    return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
  File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/cuda/__init__.py", line 192, in _lazy_init
    _check_driver()
  File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/cuda/__init__.py", line 95, in _check_driver
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled](url)
patrick22414 commented 4 years ago

You are not using the CUDA version of PyTorch. Try passing in an argument like python ./src/train.py --device cpu, or, if you have a NVIDIA GPU, reinstall the CUDA version of PyTorch following https://pytorch.org/get-started/locally/