Docker - can't run tutorials?

I’ve tried both tvmai/demo-cpu and gpu. Running python3, I enter “import tvm”.
=> Module not found.

Am I missing something here? I would’ve expected to be able to run the tutorials at least…

Thx!

Looks like TVM didn’t successfully be installed in your docker image. Did you see any error message when building the docker image?

Hi @pgaston

You might need to check whether the environment variable is set, properly.

export TVM_HOME=/path/to/tvm
export PYTHONPATH=$TVM_HOME/python:$TVM_HOME/topi/python:$TVM_HOME/nnvm/python:${PYTHONPATH} 

https://docs.tvm.ai/install/from_source.html

if you run the script ‘docker/bash.sh’, it set environment PYTHONPATH=python:topi/python, you should run python3 in source code dir which is /workspace in docker. @pgaston

Okay. Turns out that the docker image needs tvm to be built from scratch, per the documentation. (My surprise is that I thought this was the purpose of the docker image.) . After that all works fine. Don’t forget to commit your image after you build!

Or, try cchung100m’s instructions above. That may be all that’s needed.

Yes, this also does not make sense to me. Why have a docker image if you need to build it from scratch first? Did those commands work for you?