‘tvm’ has no attribute ‘device’

In the tutorial, using python api to compile ResNet50 model, I encountered the following error: Source code: .text-only,.text-card-text{white-space: pre;}.rich-text-paragraph{min-height: 15px;}

dev = tvm.device(str(target), 0) module = graph_executor.GraphModule(lib"default")

Error: .text-only,.text-card-text{white-space: pre;}.rich-text-paragraph{min-height: 15px;}

AttributeError: module ‘tvm’ has no attribute ‘device’

Check your TVM version

if version >= 0.8, use device, else use context

2 Likes