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

RuntimeError: Device index must not be negative #14

Open
YeJinPaark opened this issue Aug 18, 2023 · 1 comment
Open

RuntimeError: Device index must not be negative #14

YeJinPaark opened this issue Aug 18, 2023 · 1 comment

Comments

@YeJinPaark
Copy link

08/18/2023 05:15:37 - INFO - /mnt/ssd_mnt/pyj/ASP/util/runner.py - Log file path: /mnt/ssd_mnt/pyj/ASP/data/ontonotes_coref/t5_base/log_Aug18_05-15-37.txt
08/18/2023 05:15:37 - INFO - util.tensorize_coref - Loaded tensorized examples from cache: /mnt/ssd_mnt/pyj/ASP/data/ontonotes_coref/cached.tensors.t5-small.2048.bin
/opt/conda/envs/asp/lib/python3.8/site-packages/torch/cuda/init.py:546: UserWarning: Can't initialize NVML
warnings.warn("Can't initialize NVML")
Traceback (most recent call last):
File "run_coref.py", line 121, in
model, _ = runner.initialize_model()
File "/mnt/ssd_mnt/pyj/ASP/util/runner.py", line 78, in initialize_model
model = self.model_class_fn(self.config, self.device)
File "/mnt/ssd_mnt/pyj/ASP/models/model_coref.py", line 49, in init
self.model = T5Coref.from_pretrained(
File "/opt/conda/envs/asp/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2228, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
File "/mnt/ssd_mnt/pyj/ASP/models/t5_coref.py", line 62, in init
self.action_head = util.make_ffnn(
File "/mnt/ssd_mnt/pyj/ASP/util/func.py", line 402, in make_ffnn
ffnn = [make_linear(feat_size, hidden_size[0], std=std), ACT2FN[activation], dropout]
File "/mnt/ssd_mnt/pyj/ASP/util/func.py", line 385, in make_linear
linear = nn.Linear(
File "/opt/conda/envs/asp/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 96, in init
self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
RuntimeError: Device index must not be negative

How can I fix it??

@7jun-ui
Copy link

7jun-ui commented Jun 3, 2024

It needs GPU

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

No branches or pull requests

2 participants