You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
#18
Open
pcdreams2 opened this issue
Dec 2, 2020
· 1 comment
When I run a test with a webcam or file, an error is thrown: Traceback (most recent call last): File "video_deepsort.py", line 47, in <module> for image, detections, _ in video_detector.detect("rtsp://admin:[email protected]/ISAPI/Streaming/Channels/101", File "A:\ml\yolo_deepsort\yolo3\detect\video_detect.py", line 135, in detect detections = self.image_detector.detect(frame) File "A:\ml\yolo_deepsort\yolo3\detect\img_detect.py", line 86, in detect detections = self.model(image) File "C:\Users\pcdreams\miniconda3\envs\yolo_deepsort\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "A:\ml\yolo_deepsort\yolo3\models\models.py", line 308, in forward x, layer_loss = module[0](x, targets, img_dim) File "C:\Users\pcdreams\miniconda3\envs\yolo_deepsort\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "A:\ml\yolo_deepsort\yolo3\models\models.py", line 217, in forward pred_conf.view((num_samples, -1, 1)), RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
When I run a test with a webcam or file, an error is thrown:
Traceback (most recent call last): File "video_deepsort.py", line 47, in <module> for image, detections, _ in video_detector.detect("rtsp://admin:[email protected]/ISAPI/Streaming/Channels/101", File "A:\ml\yolo_deepsort\yolo3\detect\video_detect.py", line 135, in detect detections = self.image_detector.detect(frame) File "A:\ml\yolo_deepsort\yolo3\detect\img_detect.py", line 86, in detect detections = self.model(image) File "C:\Users\pcdreams\miniconda3\envs\yolo_deepsort\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "A:\ml\yolo_deepsort\yolo3\models\models.py", line 308, in forward x, layer_loss = module[0](x, targets, img_dim) File "C:\Users\pcdreams\miniconda3\envs\yolo_deepsort\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "A:\ml\yolo_deepsort\yolo3\models\models.py", line 217, in forward pred_conf.view((num_samples, -1, 1)), RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
whats a problem with view?
pytorch - 1.7.0
torchvision - 0.8.1
opencv-python - 4.4.0.46
The text was updated successfully, but these errors were encountered: