InseeFrLab / InseeFrLab/torchTextClassifiers

GPU usage in docs

Open Beginner friendly
#93 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
23
Forks
7
PR merge metrics
No merged PRs in 30d

Description

https://github.com/InseeFrLab/torchTextClassifiers/blame/9a8b215dde66d6d549f4e479899edbb7c287fc12/docs/source/getting_started/quickstart.md#L262

`accelerator="gpu"` does not work for me, but `accelerator="cuda" ` works instead (as in `torch.device`).

Details of the error:

```
Traceback (most recent call last):
File "path/to/train_script.py", line xxx, in main
ttc.train(
~~~~~~~~~^
X_train,
^^^^^^^^
...<4 lines>...
verbose=True,
^^^^^^^^^^^^^
)
^
File path/to/torchTextClassifiers/torchTextClassifiers.py", line 401, in train
device = torch.device(training_config.accelerator)
RuntimeError: Expected one of cpu, cuda, ipu, xpu, mkldnn, opengl, opencl, ideep, hip, ve, fpga, maia, xla, lazy, vulkan, mps, meta, hpu, mtia, privateuseone device type at start of device string: gpu
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Open docs/source/getting_started/quickstart.md at the referenced line and compare the documented accelerator value with the accepted PyTorch device types shown in the traceback. Check torchTextClassifiers.py around line 401 and run the quickstart or its documentation checks; done means the quickstart uses a working accelerator value and no longer produces the reported device-string error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.