devit
devit copied to clipboard
How to use prototypes.pth that only contains a single class?
I want to train a few shot object detector to recognize only a single class, which I built prototypes for using this blueprint: https://github.com/mlzxy/devit/blob/main/demo/build_prototypes.ipynb
Now when I run python demo/demo.py
with some other images of the same class as input, I get an error, presumably because I only have a single class in my prototypes:
File "demo/demo.py", line 272, in <module>
fire.Fire(main)
File "/home/appuser/.local/lib/python3.8/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/home/appuser/.local/lib/python3.8/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/home/appuser/.local/lib/python3.8/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "demo/demo.py", line 221, in main
output = model(batched_inputs)[0]
File "/home/appuser/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/home/appuser/devit/demo/../detectron2/modeling/meta_arch/devit.py", line 1168, in forward
other_classes = interpolate(other_classes, self.T, mode='linear') # (Nxclasses) x spatial x T
File "/home/appuser/devit/demo/../detectron2/modeling/meta_arch/devit.py", line 86, in interpolate
return F.interpolate(seq, T, mode=mode)
File "/home/appuser/.local/lib/python3.8/site-packages/torch/nn/functional.py", line 3945, in interpolate
return torch._C._nn.upsample_linear1d(input, output_size, align_corners, scale_factors)
RuntimeError: Input and output sizes should be greater than 0, but got input (W: 0) and output (W: 128)
Any hunch as to how I can solve this? Might the issue be that I did not explicitly train few shot object detector using https://github.com/mlzxy/devit/blob/main/tools/train_net.py ?