TVMError: Check failed: gv.defined() && gv->IsInstance<GlobalVarNode>():

Bug description:
when I use compile a keras model, It crashed. The crash message is shown as followsing:

Conditions(triggering this bug)

  1. target= ‘cuda’
  2. opt_level = 1
  3. use relay.vm.compile() to compile rather than

Only when these three conditions are met at the same time, the bug will be triggered.

The Reproducible script

import keras
import tvm
import tvm.relay as relay

model_path = './xception-imagenet_origin.h5'

predict_model = keras.models.load_model(model_path)
shape_dict = {'input_7': (1, 3, 299, 299)}
irmod, params = relay.frontend.from_keras(predict_model, shape_dict)
target = 'cuda'
ctx = tvm.gpu(0)

with tvm.transform.PassContext(opt_level=1):
   # graph, lib, params =, target, params=params)
   vm_exec = relay.vm.compile(irmod, target, params=params)


TVM : 0.8.dev0
OS: Ubuntu 16.04

Anyone can download this Keras model from the below link:

@FrozenGene @merrymercy @comaniac Could you give me some advice?