|
更新debian固件后,执行如下的转换脚本:
from rknn.api import RKNN
INPUT_SIZE = 160
if __name__ == '__main__':
rknn = RKNN()
rknn.config(channel_mean_value='0 0 0 255', reorder_channel='0 1 2')
print('--> Loading model')
rknn.load_tensorflow(tf_pb='combine_face_encode.pb', inputs=['import/input'], outputs=['my_output'], input_size_list=[[INPUT_SIZE, INPUT_SIZE, 3]])
print('done')
print('--> Building model')
rknn.build(do_quantization=False)
print('done')
rknn.export_rknn('./facenet_final.rknn')
rknn.release()
截取出错误的地方如下:
--> Loading model
W:tensorflow:From /home/toybrick/.local/lib/python3.7/site-packages/rknn/api/rknn.py:65: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.compat.v1.graph_util.extract_sub_graph`
Killed
使用dmesg截取出kill进程的日志如下:
[ 1737.428830] Out of memory: Kill process 2438 (python3) score 778 or sacrifice child
[ 1737.429885] Killed process 2438 (python3) total-vm:2377848kB, anon-rss:1557724kB, file-rss:0kB
我的pb模型有90M这么大,这是因为加载pb模型太大内存不够吗?在之前fedora上没事的,这里怎么解决啊?
|
|