GPU usage in docs

Open Beginner friendly
#93 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

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
Dominant language
Python
Stars
23
Forks
7
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InseeFrLab/torchTextClassifiers

All issues in InseeFrLab/torchTextClassifiers

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.