Skip to content

[Bug] ImportError: cannot import name 'get_const_float' from partially initialized module 'tvm.topi.utils' #13113

Description

@yuwenjun1988

Expected behavior
No Crash

Actual behavior
Crash Stack
Traceback (most recent call last):
File "/home/yuwenjun/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/yuwenjun/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/mnt/e/code/tvm/python/tvm/exec/popen_worker.py", line 105, in
main()
File "/mnt/e/code/tvm/python/tvm/exec/popen_worker.py", line 77, in main
fn, args, kwargs, timeout = cloudpickle.loads(reader.read(bytes_size))
File "/mnt/e/code/tvm/python/tvm/autotvm/task/task.py", line 199, in setstate
self.func = cloudpickle.loads(state["func"])
File "/mnt/e/code/tvm/python/tvm/topi/init.py", line 37, in
from .transform import *
File "/mnt/e/code/tvm/python/tvm/topi/transform.py", line 26, in
from .utils import within_index, make_idx, const_vector
File "/mnt/e/code/tvm/python/tvm/topi/utils.py", line 25, in
from tvm import relay, te
File "/mnt/e/code/tvm/python/tvm/relay/init.py", line 29, in
from . import prelude
File "/mnt/e/code/tvm/python/tvm/relay/prelude.py", line 21, in
from tvm.relay.transform import ToANormalFormExpr
File "/mnt/e/code/tvm/python/tvm/relay/transform/init.py", line 22, in
from . import fake_quantization_to_integer, mixed_precision
File "/mnt/e/code/tvm/python/tvm/relay/transform/fake_quantization_to_integer.py", line 25, in
from tvm.relay.qnn.op import canonicalizations
File "/mnt/e/code/tvm/python/tvm/relay/qnn/init.py", line 20, in
from . import op
File "/mnt/e/code/tvm/python/tvm/relay/qnn/op/init.py", line 21, in
from .qnn import *
File "/mnt/e/code/tvm/python/tvm/relay/qnn/op/qnn.py", line 26, in
from tvm.relay.op.nn.utils import get_pad_tuple2d
File "/mnt/e/code/tvm/python/tvm/relay/op/init.py", line 34, in
from . import strategy
File "/mnt/e/code/tvm/python/tvm/relay/op/strategy/init.py", line 22, in
from .generic import *
File "/mnt/e/code/tvm/python/tvm/relay/op/strategy/generic.py", line 24, in
from tvm.topi.utils import (
ImportError: cannot import name 'get_const_float' from partially initialized module 'tvm.topi.utils' (most likely due to a circular import) (/mnt/e/code/tvm/python/tvm/topi/utils.py)

Environment
Ubuntu 18.04 TVM 0.11.dev0
Any environment details, such as: Operating System, TVM version, etc

Steps to reproduce
run autotvm_relay_x86.py
https://tvm.apache.org/docs/tutorial/autotvm_relay_x86.html#sphx-glr-download-tutorial-autotvm-relay-x86-py

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions