jikechao opened a new issue, #14718:
URL: https://github.com/apache/tvm/issues/14718
### Steps to reproduce
```
import tvm
import tvm.relay as relay
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers, models
input_shape = (2, 3, 4)
input_data = np.random.random(input_shape)
x = layers.Input(shape=input_shape[1:], dtype='float32')
layer = keras.layers.BatchNormalization()
layer.set_weights(layer.get_weights())
y = layer(x)
model = models.Model(x, y)
print(model.summary())
shape_dict = {'input_1': input_shape}
mod, params = relay.frontend.from_keras(model, shape_dict)
with tvm.transform.PassContext(opt_level=3):
model = relay.build_module.create_executor("graph", mod, tvm.cpu(0),
'llvm', params).evaluate()
```
### StackTrace
```
The Relay type checker is unable to show the following types match:
Tensor[(3), float32]
Tensor[(4), float32]
In particular:
dimension 0 conflicts: 3 does not match 4.
The Relay type checker is unable to show the following types match.
In particular `Tensor[(4), float32]` does not match `Tensor[(3), float32]`
The Relay type checker is unable to show the following types match:
Tensor[(3), float32]
Tensor[(4), float32]
In particular:
dimension 0 conflicts: 3 does not match 4.
The Relay type checker is unable to show the following types match.
In particular `Tensor[(4), float32]` does not match `Tensor[(3), float32]`
The Relay type checker is unable to show the following types match:
Tensor[(3), float32]
Tensor[(4), float32]
In particular:
dimension 0 conflicts: 3 does not match 4.
The Relay type checker is unable to show the following types match.
In particular `Tensor[(4), float32]` does not match `Tensor[(3), float32]`
The Relay type checker is unable to show the following types match:
Tensor[(3), float32]
Tensor[(4), float32]
In particular:
dimension 0 conflicts: 3 does not match 4.
The Relay type checker is unable to show the following types match.
In particular `Tensor[(4), float32]` does not match `Tensor[(3), float32]`
Traceback (most recent call last):
File "test.py", line 23, in <module>
model = relay.build_module.create_executor("graph", mod, tvm.cpu(0),
'llvm', params).evaluate()
File
"/workplace/software/tvm/tvm/python/tvm/relay/backend/interpreter.py", line
171, in evaluate
return self._make_executor()
File "/workplace/software/tvm/tvm/python/tvm/relay/build_module.py", line
513, in _make_executor
self.mod = InferType()(self.mod)
File "/workplace/software/tvm/tvm/python/tvm/ir/transform.py", line 160,
in __call__
return _ffi_transform_api.RunPass(self, mod)
File "/workplace/software/tvm/tvm/python/tvm/_ffi/_ctypes/packed_func.py",
line 237, in __call__
raise get_last_ffi_error()
tvm.error.DiagnosticError: Traceback (most recent call last):
7: TVMFuncCall
6:
tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::runtime::TypedPackedFunc<tvm::IRModule
(tvm::transform::Pass,
tvm::IRModule)>::AssignTypedLambda<tvm::transform::$_6>(tvm::transform::$_6,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>)::{lambda(tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*)#1}>
>::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs,
tvm::runtime::TVMRetValue*)
5: tvm::transform::Pass::operator()(tvm::IRModule) const
4: tvm::transform::Pass::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
3: tvm::transform::ModulePassNode::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
2:
tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::runtime::TypedPackedFunc<tvm::IRModule
(tvm::IRModule,
tvm::transform::PassContext)>::AssignTypedLambda<tvm::relay::transform::InferType()::$_2>(tvm::relay::transform::InferType()::$_2)::{lambda(tvm::runtime::TVMArgs
const&, tvm::runtime::TVMRetValue*)#1}> >::Call(tvm::runtime::PackedFuncObj
const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)
1: tvm::DiagnosticContext::Render()
0: _ZN3tvm7runtime6detail
File "/workplace/software/tvm/tvm/src/ir/diagnostic.cc", line 131
DiagnosticError: one or more error diagnostics were emitted, please check
diagnostic render for output.
```
### Triage
* flow:relay
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]