Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System crash when loading DPT_Hybrid #256

Open
Benblob688 opened this issue Nov 20, 2023 · 0 comments
Open

System crash when loading DPT_Hybrid #256

Benblob688 opened this issue Nov 20, 2023 · 0 comments

Comments

@Benblob688
Copy link

I'm using a Raspberry Pi 5 with the latest Raspberry Pi OS Lite (headless).

I have a simple script taken from the Google Collab example: https://colab.research.google.com/github/pytorch/pytorch.github.io/blob/master/assets/hub/intelisl_midas_v2.ipynb

#!/usr/bin/env python3

import cv2
import torch
import urllib.request

import matplotlib.pyplot as plt

model_type = "DPT_Large"     # MiDaS v3 - Large     (highest accuracy, slowest inference speed)
#model_type = "DPT_Hybrid"   # MiDaS v3 - Hybrid    (medium accuracy, medium inference speed)
#model_type = "MiDaS_small"  # MiDaS v2.1 - Small   (lowest accuracy, highest inference speed)

midas = torch.hub.load("intel-isl/MiDaS", model_type, trust_repo=True)

I am just trying to load the different models. DTP_Large and MiDaS_small both load fine, but DPT_Hybrid has some issues.

I repeatedly see this output and then the Pi konks out, entire system shuts down.

(WxStation.env) ben@wx-two:~/WxStation $ python3 SegmentSky.py 
Downloading: "https://github.com/intel-isl/MiDaS/zipball/master" to /home/ben/.cache/torch/hub/master.zip
/home/ben/WxStation.env/lib/python3.11/site-packages/timm/models/_factory.py:114: UserWarning: Mapping deprecated model name vit_base_resnet50_384 to current vit_base_r50_s16_384.orig_in21k_ft_in1k.
  model = create_fn(
client_loop: send disconnect: Broken pipe

Sometimes it will get to downloading and do: Using cache found in /home/ben/.cache/torch/hub/intel-isl_MiDaS_master, but still crashes whole system. One time I got it to download the model weights itself, but it was super slow and froze up the pi over ssh. This behaviour did not happen when downloading the Large and small models.

Even after downloading the weights, the system would shutdown on just trying to load the Hybrid model from memory. Odd because the Large should be harder for the Pi to handle. I checked CPU temps and these never went above 60 ºC and CPU above 25% or memory above 10%.

What can I do next to help diagnosis?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant