tokenizer = BertTokenizer.load('bert-base-uncased')
model = BertModel.load('bert-base-uncased', force_download=False)
model.set_train(True)
inputs = tokenizer("hello world")
outputs = model(inputs)`
但是最后一行代码,即将inputs传入model,报以下错误:
TypeError: mindspore\ccsrc\pipeline\jit\pipeline.cc:235 CheckArgsValid] The inputs types of the outermost network support bool, int, float, None, tensor, mstype.Number(mstype.bool, mstype.int, mstype.float, mstype.uint), and tuple or list containing only these types, and dict whose values are these types, but the 0th arg type is <class 'list'>, value is '['hello', 'world']'.
你好, 我运行了该段代码, `from bert4ms import BertModel,BertTokenizer
tokenizer = BertTokenizer.load('bert-base-uncased') model = BertModel.load('bert-base-uncased', force_download=False) model.set_train(True)
inputs = tokenizer("hello world")
outputs = model(inputs)`
但是最后一行代码,即将inputs传入model,报以下错误:
TypeError: mindspore\ccsrc\pipeline\jit\pipeline.cc:235 CheckArgsValid] The inputs types of the outermost network support bool, int, float, None, tensor, mstype.Number(mstype.bool, mstype.int, mstype.float, mstype.uint), and tuple or list containing only these types, and dict whose values are these types, but the 0th arg type is <class 'list'>, value is '['hello', 'world']'.
这是什么原因呢?