I try to run below command on a docker environment,
python3 -m tvm.driver.tvmc --target “llvm” --output resnet50-v2-7.onnx.tar resnet50-v2-7.onnx
docker file:
file 1
FROM ubuntu:18.04
RUN apt-get update --fix-missing
RUN apt-get update
RUN apt-get install -y wget
RUN apt-get install -y python3 python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev
RUN apt-get install -y python3-pip
RUN pip3 install numpy decorator attrs scipy
RUN apt-get install -y git
COPY clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04 /llvm
COPY install_tvm_cpu.sh /install/install_tvm_cpu.sh
RUN bash /install/install_tvm_cpu.sh
ENV TVM_LOG_DEBUG=1
ENV TVM_HOME=/tvm
ENV PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}
RUN wget https://github.com/onnx/models/raw/master/vision/classification/resnet/model/resnet50-v2-7.onnx
RUN pip3 install onnx==1.6.0
RUN pip3 install onnxruntime==1.0.0
RUN apt-get install -y vim
install_tvm_cpu.sh:
set -e
set -u
set -o pipefail
git clone GitHub - apache/tvm: Open deep learning compiler stack for cpu, gpu and specialized accelerators tvm --recursive
cd /tvm
mkdir -p build
cp cmake/config.cmake build
cd build
echo set(USE_LLVM /llvm/bin/llvm-config) >> config.cmake
echo set(USE_GRAPH_EXECUTOR ON) >> config.cmake
echo set(USE_PROFILER ON) >> config.cmake
cmake …
make -j10