I am given the ground truth about the bounding box around a particular object in an image.
I am using a convolutional neural network to predict the bounding boxes as a 1 x 4 tensor.
But the problem is that in the given dataset, the ground truth bounding box values are given as a list. So
i am getting this error for the BB as shown below
inputs, labelsv, BBv = Variable(inputs), Variable(labels),Variable(BB)
RuntimeError: Variable data has to be a tensor, but got list
Please help how to rectify it and calculate the loss
Variable(torch.Tensor(BB)). You can replace torch.Tensor with the type of desired precision, e.g. torch.DoubleTensor, torch.HalfTensor. If you run on GPU , remember to add .cuda() to either the Tensor or the Variable.
And the output prints:
152
106
151
130
[torch.LongTensor of size 4]
]
<class ‘list’>
BB = torch.Tensor(BB)
TypeError: ‘torch.LongTensor’ object does not support indexing