GXYM/DRRG

Please Help!!

Mary63 opened this issue · 1 comments

I still get this error when trying to train the model:

load the vgg16 weight from ./cache
Start training TextGraph.
Epoch: 0 : LR = [0.001]
Traceback (most recent call last):
File "train_TextGraph.py", line 236, in
main()
File "train_TextGraph.py", line 217, in main
train(model, train_loader, criterion, scheduler, optimizer, epoch, logger)
File "train_TextGraph.py", line 74, in train
output, gcn_data = model(img, gt_roi, to_device)
File "/home/ubuntu/cli-ve/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/ubuntu/DRRG/network/textnet.py", line 122, in forward
feat_batch, adj_batch, h1id_batch, gtmat_batch = self.graph(graph_feat, roi_data)
File "/home/ubuntu/DRRG/layers/gcn_layer.py", line 176, in call
batch_data = self.graph_IPS(feat_bin, labels_bin, hops_bin, one_hops_bin, knn_graph_bin)
File "/home/ubuntu/DRRG/layers/gcn_layer.py", line 114, in graph_IPS
& labels_gt[center_idx] > 0).int()
RuntimeError: result type Long can't be cast to the desired output type Bool

Could you please help me with that? I do appreciate your help.

GXYM commented

I still get this error when trying to train the model:

load the vgg16 weight from ./cache
Start training TextGraph.
Epoch: 0 : LR = [0.001]
Traceback (most recent call last):
File "train_TextGraph.py", line 236, in
main()
File "train_TextGraph.py", line 217, in main
train(model, train_loader, criterion, scheduler, optimizer, epoch, logger)
File "train_TextGraph.py", line 74, in train
output, gcn_data = model(img, gt_roi, to_device)
File "/home/ubuntu/cli-ve/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/ubuntu/DRRG/network/textnet.py", line 122, in forward
feat_batch, adj_batch, h1id_batch, gtmat_batch = self.graph(graph_feat, roi_data)
File "/home/ubuntu/DRRG/layers/gcn_layer.py", line 176, in call
batch_data = self.graph_IPS(feat_bin, labels_bin, hops_bin, one_hops_bin, knn_graph_bin)
File "/home/ubuntu/DRRG/layers/gcn_layer.py", line 114, in graph_IPS
& labels_gt[center_idx] > 0).int()
RuntimeError: result type Long can't be cast to the desired output type Bool

Could you please help me with that? I do appreciate your help.

This may be caused by Python and python versions. You can modify the data type of the corresponding tensor according to the error message.