Untitled conversation
- User
[rank6]: Traceback (most recent call last): [rank6]: File "/publicssd/FW-20230525-01/Husformer/main-3.py", line 123, in [rank6]: test_loss = train.initiate(hyp_params, train_loader, valid_loader, test_loader, local_rank) [rank6]: File "/publicssd/FW-20230525-01/Husformer/src/train.py", line 33, in initiate [rank6]: return train_model(settings, hyp_params, train_loader, valid_loader, test_loader, local_rank) [rank6]: File "/publicssd/FW-20230525-01/Husformer/src/train.py", line 146, in train_model [rank6]: _, mae_train = train(model, optimizer, criterion, settings['scaler']) [rank6]: File "/publicssd/FW-20230525-01/Husformer/src/train.py", line 82, in train [rank6]: raw_loss = criterion(preds, eval_attr) [rank6]: File "/share/home/heruliang/conda/envs/hus/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl [rank6]: return self._call_impl(*args, **kwargs) [rank6]: File "/share/home/heruliang/conda/envs/hus/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl [rank6]: return forward_call(*args, **kwargs) [rank6]: File "/publicssd/FW-20230525-01/Husformer/src/utils.py", line 106, in forward [rank6]: logpt = log_softmax.gather(1, target.view(-1, 1)) [rank6]: RuntimeError: CUDA error: device-side assert triggered [rank6]: Compile with
TORCH_USE_CUDA_DSAto enable device-side assertions. 这个报错怎么解决 - Assistant
这个错误通常是由于CUDA在运行时遇到了设备端(device-side)的断言失败,常见的原因是使用了非法的索引或维度,导致了CUDA无法正确执行操作。
从您的错误信息来看,问题出现在
utils.py的第106行:logpt = log_softmax.gather(1, target.view(-1, 1))这是在执行
gather操作时发生的错误。gather函数会根据target中的索引,从log_softmax中收集相应的值。如果target中的索引超出了log_softmax的范围,就会触发设备端的断言失败。可能的原因和解决方法如下:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.