Hi,
I am training a joint segmentation-classification model and the loss is the weighted average of the losses.
                    loss = w_seg * loss_seg + w_cls * loss_cls
                    model.zero_grad()
                    print(loss)
                    loss.backward()

loss is created and printed but I have an error on loss.backward():
tensor(0.6947, grad_fn=< AddBackward0 >)
Traceback (most recent call last):
File “main.py”, line 140, in 
main(config)
File “main.py”, line 80, in main
solver.train()
File “/project/6027897/meyta/Codes/Joint/4-11/Compile_nets.py”, line 346, in train
loss.backward()
File “/home/meyta/.local/lib/python3.8/site-packages/torch/tensor.py”, line 245, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File “/home/meyta/.local/lib/python3.8/site-packages/torch/autograd/init.py”, line 145, in backward
Variable._execution_engine.run_backward(
RuntimeError: could not create a primitive
Does anyone has an idea about the error?