嗨,我得到了以下错误:“分割故障”在我的覆盆子Pi 4型号B,我是跟随大卫·田的“建造智能机器人车指南”,它使用深度学习。
一些重要的信息:
起初,我试图为TensorFlow安装EdgeTPU,如下所示:
wget https://dl.google.com/coral/edgetpu_api/edgetpu_api_latest.tar.gz -O edgetpu_api.tar.gz --trust-server-names
tar xzf edgetpu_api.tar.gz
cd edgetpu_api/
bash ./install.sh -y
sudo reboot now这不适用于新的树莓Pi 4,所以我跟踪了本指令
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install libedgetpu1-std
pip3 install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl
sudo apt-get install libedgetpu1-max
mkdir coral && cd coral
git clone https://github.com/google-coral/tflite.git
cd tflite/python/examples/classification
bash install_requirements.sh
python3 classify_image.py \
--model models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
--labels models/inat_bird_labels.txt \
--input images/parrot.jpg这不是我的问题。这个例子很好用。
回到田的向导,我试着跟随
cd ~/DeepPiCar/models/object_detection/
python3 code/coco_object_detection.py
Segmentation fault您可以查看这段代码这里
我不确定它是配置还是安装,还是代码中的问题。我认为分割故障是由于珊瑚边缘TPU造成的。
我也试过
sudo apt-get update
sudo apt-get install python3-edgetpu我还能做什么?有人能帮忙吗?提前谢谢。
发布于 2021-04-07 16:35:12
我在Pi 3B上也有同样的问题--我得到的跟踪输出如下:
--- modulename: coco_object_detection, funcname:
coco_object_detection.py(28): labels = dict((int(k), v) for k, v in pairs)
--- modulename: coco_object_detection, funcname:
coco_object_detection.py(27): pairs = (l.strip().split(maxsplit=1) for l in f.readlines())
coco_object_detection.py(31): IM_WIDTH = 640
coco_object_detection.py(32): IM_HEIGHT = 480
coco_object_detection.py(33): camera = cv2.VideoCapture(0)
coco_object_detection.py(34): ret = camera.set(3,IM_WIDTH)
coco_object_detection.py(35): ret = camera.set(4,IM_HEIGHT)
coco_object_detection.py(37): font = cv2.FONT_HERSHEY_SIMPLEX
coco_object_detection.py(38): bottomLeftCornerOfText = (10,IM_HEIGHT-10)
coco_object_detection.py(39): fontScale = 1
coco_object_detection.py(40): fontColor = (255,255,255) # white
coco_object_detection.py(41): boxColor = (0,0,255) # RED?
coco_object_detection.py(42): boxLineWidth = 1
coco_object_detection.py(43): lineType = 2
coco_object_detection.py(45): annotate_text = ""
coco_object_detection.py(46): annotate_text_time = time.time()
coco_object_detection.py(47): time_to_show_prediction = 1.0 # ms
coco_object_detection.py(48): min_confidence = 0.20
coco_object_detection.py(51): engine = edgetpu.detection.engine.DetectionEngine(args.model)
--- modulename: engine, funcname: init
engine.py(69): if device_path:
engine.py(72): super().init(model_path)
--- modulename: basic_engine, funcname: init
basic_engine.py(36): if device_path:
basic_engine.py(40): self._engine = BasicEnginePythonWrapper.CreateFromFile(model_path)
free(): invalid pointer
Abortedhttps://stackoverflow.com/questions/60638523
复制相似问题