here comes the error
--training batch: 39%|███▉ | 999/2567 [03:57<06:04, 4.30it/s]epoch: 23, iteration: 1000, current mean loss: 0.13
--training batch: 78%|███████▊ | 1999/2567 [07:54<02:37, 3.61it/s]epoch: 23, iteration: 2000, current mean loss: 0.13
--training batch: 100%|█████████▉| 2566/2567 [10:07<00:00, 4.22it/s]
Traceback (most recent call last):
File "universal_main.py", line 422, in <module>
if __name__ == "__main__":
File "universal_main.py", line 398, in main
dev=conf.device, tokenizer=tokenizer, num_labels=num_labels,
File "universal_main.py", line 138, in train
scaler.scale(loss).backward()
File "/usr/local/lib/python3.7/dist-packages/torch/_tensor.py", line 255, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "/usr/local/lib/python3.7/dist-packages/torch/autograd/__init__.py", line 149, in backward
allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag
IndexError: scatter_(): Expected dtype int64 for index.
Exception raised from scatter_add_ at /pytorch/aten/src/ATen/native/TensorAdvancedIndexing.cpp:1082 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x7fa0603bda22 in /usr/local/lib/python3.7/dist-packages/torch/lib/libc10.so)
frame #1: at::native::scatter_add_(at::Tensor&, long, at::Tensor const&, at::Tensor const&) + 0x11b (0x7fa061ac337b in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #2: <unknown function> + 0xbccd62 (0x7fa015338d62 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cuda_cu.so)
frame #3: at::redispatch::scatter_add_(c10::DispatchKeySet, at::Tensor&, long, at::Tensor const&, at::Tensor const&) + 0xb5 (0x7fa0620ddb15 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #4: <unknown function> + 0x350ddad (0x7fa063d49dad in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #5: at::redispatch::scatter_add_(c10::DispatchKeySet, at::Tensor&, long, at::Tensor const&, at::Tensor const&) + 0xb5 (0x7fa0620ddb15 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #6: <unknown function> + 0x2fae5bb (0x7fa0637ea5bb in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #7: at::Tensor::scatter_add_(long, at::Tensor const&, at::Tensor const&) const + 0x151 (0x7fa062568bc1 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #8: at::native::gather_backward(at::Tensor const&, at::Tensor const&, long, at::Tensor const&, bool) + 0x87 (0x7fa061ad7b67 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #9: <unknown function> + 0x1b8556d (0x7fa0623c156d in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #10: at::gather_backward(at::Tensor const&, at::Tensor const&, long, at::Tensor const&, bool) + 0x194 (0x7fa061ef4a04 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #11: torch::autograd::generated::GatherBackward::apply(std::vector<at::Tensor, std::allocator<at::Tensor> >&&) + 0x1b7 (0x7fa063722837 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #12: <unknown function> + 0x355a3fa (0x7fa063d963fa in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #13: torch::autograd::Engine::evaluate_function(std::shared_ptr<torch::autograd::GraphTask>&, torch::autograd::Node*, torch::autograd::InputBuffer&, std::shared_ptr<torch::autograd::ReadyQueue> const&) + 0x1477 (0x7fa063d91c77 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #14: torch::autograd::Engine::thread_main(std::shared_ptr<torch::autograd::GraphTask> const&) + 0x47b (0x7fa063d929fb in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #15: torch::autograd::Engine::thread_init(int, std::shared_ptr<torch::autograd::ReadyQueue> const&, bool) + 0x89 (0x7fa063d8ac49 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_cpu.so)
frame #16: torch::autograd::python::PythonEngine::thread_init(int, std::shared_ptr<torch::autograd::ReadyQueue> const&, bool) + 0x53 (0x7fa1051b94b3 in /usr/local/lib/python3.7/dist-packages/torch/lib/libtorch_python.so)
frame #17: <unknown function> + 0xbbb2f (0x7fa10639eb2f in /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
frame #18: <unknown function> + 0x7fa3 (0x7fa107ea1fa3 in /lib/x86_64-linux-gnu/libpthread.so.0)
frame #19: clone + 0x3f (0x7fa1079e84cf in /lib/x86_64-linux-gnu/libc.so.6)