1 min readMay 19, 2020
Good post. However, after following your instructions I get the following error in Colab:
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py:2854: UserWarning: The default behavior for interpolate/upsample with float scale_factor will change in 1.6.0 to align with other frameworks/libraries, and use scale_factor directly, instead of relying on the computed output size. If you wish to keep the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details.
warnings.warn("The default behavior for interpolate/upsample with float scale_factor will change "---------------------------------------------------------------------------RuntimeError Traceback (most recent call last)<ipython-input-5-c60d8a8a6e80> in <module>()
2 from detecto import core, utils, visualize
3 image = utils.read_image('images/cat/cat0.jpg')
----> 4 predictions = model.predict(image)
5 # predictions format: (labels, boxes, scores)
6 labels, boxes, scores = predictions
7 frames
/usr/local/lib/python3.6/dist-packages/torchvision/models/detection/_utils.py in decode(self, rel_codes, boxes)
183 box_sum += val
184 pred_boxes = self.decode_single(
--> 185 rel_codes.reshape(box_sum, -1), concat_boxes
186 )
187 return pred_boxes.reshape(box_sum, -1, 4)RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1] because the unspecified dimension size -1 can be any value and is ambiguous
Any ideas???