很感谢你们的开源,我在使用HMCN适配我的数据集的时候遇到了如下问题,貌似是global_layer_output 和 local_layer_output 输出维度的问题,需要调整模型内部结构么?或者有其他修改建议?
Epoch 1 is training...
0%| | 0/1726 [00:04<?, ?it/s]
Traceback (most recent call last):
File "D:/2021/Code/NeuralNLP-NeuralClassifier/train.py", line 250, in
train(config)
File "D:/2021/Code/NeuralNLP-NeuralClassifier/train.py", line 218, in train
trainer.train(train_data_loader, model, optimizer, "Train", epoch)
File "D:/2021/Code/NeuralNLP-NeuralClassifier/train.py", line 99, in train
return self.run(data_loader, model, optimizer, stage, epoch, ModeType.TRAIN)
File "D:/2021/Code/NeuralNLP-NeuralClassifier/train.py", line 130, in run
(global_logits, local_logits, logits) = model(batch)
File "D:\Miniconda3\envs\Torch1.0\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, *kwargs)
File "D:\2021\Code\NeuralNLP-NeuralClassifier\model\classification\hmcn.py", line 113, in forward
return global_layer_output, local_layer_output, 0.5 global_layer_output + 0.5 * local_layer_output
RuntimeError: The size of tensor a (13) must match the size of tensor b (10) at non-singleton dimension 1
很感谢你们的开源,我在使用HMCN适配我的数据集的时候遇到了如下问题,貌似是global_layer_output 和 local_layer_output 输出维度的问题,需要调整模型内部结构么?或者有其他修改建议? Epoch 1 is training... 0%| | 0/1726 [00:04<?, ?it/s] Traceback (most recent call last): File "D:/2021/Code/NeuralNLP-NeuralClassifier/train.py", line 250, in
train(config)
File "D:/2021/Code/NeuralNLP-NeuralClassifier/train.py", line 218, in train
trainer.train(train_data_loader, model, optimizer, "Train", epoch)
File "D:/2021/Code/NeuralNLP-NeuralClassifier/train.py", line 99, in train
return self.run(data_loader, model, optimizer, stage, epoch, ModeType.TRAIN)
File "D:/2021/Code/NeuralNLP-NeuralClassifier/train.py", line 130, in run
(global_logits, local_logits, logits) = model(batch)
File "D:\Miniconda3\envs\Torch1.0\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, *kwargs)
File "D:\2021\Code\NeuralNLP-NeuralClassifier\model\classification\hmcn.py", line 113, in forward
return global_layer_output, local_layer_output, 0.5 global_layer_output + 0.5 * local_layer_output
RuntimeError: The size of tensor a (13) must match the size of tensor b (10) at non-singleton dimension 1
另外,eval.py和predict.py貌似并没有适配 HMCN模型