我的Host 主機是使用Ubuntu 20.04,安裝docker之後依照Toolchain說明pull最新image
docker pull kneron/toolchain:latest
啟動docker
docker run --rm -it -v /docker-share:/docker_mount kneron/toolchain:latest
/docker-share 是我host分享出來的目錄
進入docker 環境後,下指令python 進入python環境,然後測試模組import動作
(base) root@d506fffd7db2:/workspace# python
Python 3.7.10 (default, Jun 4 2021, 14:48:32)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import onnx
>>> import ktc
use toolchain binaries
Illegal instruction (core dumped)
如上畫面,Import onnx 沒有問題,但是import ktc卻發生core dump 退出。請問為什麼呢?這部分錯誤,後續所有的轉換都無法進行了。
Tagged:
toolchain
我把指令寫在一個onnx-optimizer.py 檔執行,結果是一樣的。在python底下下指令import ktc會出錯,放到py裡面一次執行當然結果還是會錯啊。
我的onnx-optimizer.py 內容如下
import onnx
# Import the ktc package which is our Python API.
import ktc
# Load the model.
original_m = onnx.load("/workspace/yolov5s-mask_convert.onnX")
# Optimize the model using optimizer for onnx model.
optimized_m = ktc.onnx_optimizer.onnx2onnx_flow(original_m)
# Save the onnx object optimized_m to path /data1/optimized.onnx.
onnx.save(optimized_m, '/data1/optimized.onnx')
執行的結果如下
(base) root@1a1d0578a8f5:/workspace# python onnx-optimizer.py
use toolchain binaries
Illegal instruction (core dumped)
(base) root@1a1d0578a8f5:/workspace#
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Quick Links
Categories
Recent Discussions
Activity
Categories