jfzhang95 / DeepGrabCut-PyTorch

Deep GrabCut in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError

zhenmafan7 opened this issue · comments

while I trying to run the train.py, the followed error occured:
Traceback (most recent call last):
File "/home/wq/Code/DeepGrabCut/train.py", line 147, in
loss = class_balanced_cross_entropy_loss(output, gts, size_average=True, batch_average=True)
File "/home/wq/Code/DeepGrabCut/layers/loss.py", line 45, in class_balanced_cross_entropy_loss
final_loss /= np.prod(label.size())
TypeError: div_() received an invalid combination of arguments - got (numpy.int64), but expected one of:

  • (Tensor other)
    didn't match because some of the arguments have invalid types: (!numpy.int64!)
  • (float other)
    didn't match because some of the arguments have invalid types: (!numpy.int64!)

could you give me some advice to solve this problem?