plt.plot(outputs,targets)
TypeError: can’t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
Hello friends I am getting this error while plotting my waveform output (predictions) vs targets values, from the cuda as i am training my dataset on cuda gpu thats why its getting me this error I have searched online one of the solution suggested by community is to use
``` but it gives my this error
"'int' object is not callable"
while this solution
"outputs = models[0]((inputs).squeeze()).cpu()"
gives me this error
"RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!"
any other way which can solve the problem