TsingZ0 / PFLlib

37 traditional FL (tFL) or personalized FL (pFL) algorithms, 3 scenarios, and 20 datasets.
GNU General Public License v2.0
1.35k stars 283 forks source link

embedding error on Sogou_News dataset: IndexError: index out of range in self #157

Closed PengchengUp closed 9 months ago

PengchengUp commented 9 months ago

When I use the sogou_news data,I meet the following error: File "/share/home/rpcheng/PFL/system/main.py", line 456, in 0: run(args) 0: File "/share/home/rpcheng/PFL/system/main.py", line 269, in run 0: server.train() 0: File "/share/home/rpcheng/PFL/system/flcore/servers/serveravg.py", line 47, in train 0: self.evaluate() 0: File "/share/home/rpcheng/PFL/system/flcore/servers/serverbase.py", line 276, in evaluate 0: stats = self.test_metrics() #ids, num_samples(list), tot_correct(list), (tot_auc) 0: File "/share/home/rpcheng/PFL/system/flcore/servers/serverbase.py", line 249, in test_metrics 0: ct, ns = c.test_metrics() # test_acc, test_num 0: File "/share/home/rpcheng/PFL/system/flcore/clients/clientbase.py", line 123, in test_metrics 0: output = self.model(x) 0: File "/share/home/rpcheng/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl 0: return forward_call(*input, kwargs) 0: File "/share/home/rpcheng/PFL/system/flcore/trainmodel/models.py", line 19, in forward 0: out = self.base(x) 0: File "/share/home/rpcheng/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl 0: return forward_call(*input, *kwargs) 0: File "/share/home/rpcheng/PFL/system/flcore/trainmodel/models.py", line 515, in forward 0: embedded_sent = self.embedding(text) 0: File "/share/home/rpcheng/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl 0: return forward_call(input, kwargs) 0: File "/share/home/rpcheng/.local/lib/python3.6/site-packages/torch/nn/modules/sparse.py", line 160, in forward 0: self.norm_type, self.scale_grad_by_freq, self.sparse) 0: File "/share/home/rpcheng/.local/lib/python3.6/site-packages/torch/nn/functional.py", line 2044, in embedding 0: return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse) 0: IndexError: index out of range in self