使用tensorflow lite在raspberry pi 3 b+中使用yolov4模型进行对象检测

odopli94  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(403)

我尝试使用tensorflow lite在raspberry pi 3 b+中运行yolov4模型。我获取代码并尝试按照以下链接中的说明进行操作,它在我的电脑中成功运行,但在raspberry中未成功运行:https://github.com/haroonshakeel/tensorflow-yolov4-tflite
在rasbian中使用了以下命令:

cd Projects/tflite/
python -m pip install virtualenv
python -m venv tflite-env
source tflite-env/bin/activate
sudo apt -y install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev
sudo apt -y install qt4-dev-tools libatlas-base-dev libhdf5-103
python -m pip install opencv-contrib-python==4.1.0.25
uname -a
uname -m
python --version
python -m pip install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl

至于这次跑步:

python save_model.py --weights ./data/yolov4.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4 --framework tflite

它给了我:

Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info

我对权重运行了以下命令:

python convert_tflite.py --weights ./checkpoints/yolov4-416 --output ./checkpoints/yolov4-416-fp16.tflite --quantize_mode float16

有一个错误:

OSError: Unable to create file (unable to open file: name = ' ./checkpoints/yolov4-416', erno = 21, error message = 'Is a directory', flags = 13, o_flags = 242)

最后,当我尝试使用以下命令运行检测时:

python detect_video.py --weights ./checkpoints/yolov4-416.tflite --size 416 --model yolov4 --video ./data/videoNIR.AVI

我犯了这个错误:

TypeError(): load() missing 1 required positional argument: 'export dir'

有没有办法解决这些错误?谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题