TransVTSpotter
TransVTSpotter copied to clipboard
RuntimeError: median cannot be called with empty tensor
Traceback (most recent call last):
File "main_track.py", line 363, in
l think there might be something wrong with the datasets. My path of the datasets is as below:
Is that right? Can u give me some examples of the structure of the datasets or the solution to this error? Thanks!
The error is under these two Class: `class MetricLogger(object):
def __init__(self, delimiter="\t"):
self.meters = defaultdict(SmoothedValue)
self.delimiter = delimiter
def __str__(self):
loss_str = []
for name, meter in self.meters.items():
loss_str.append(
"{}: {}".format(name, str(meter))
)
return self.delimiter.join(loss_str)
class SmoothedValue(object):
@property
def median(self):
d = torch.tensor(list(self.deque))
return d.median().item()
def __str__(self):
return self.fmt.format(
median=self.median,
avg=self.avg,
global_avg=self.global_avg,
max=self.max,
value=self.value)`
Another problem is when l comment out the above error, the training just stay still. It seems that it fails to train.
l'm a rookie and just start to learn the code. Please help me with these two problems, thanks!