我有一个经过训练的模型,我正在使用CNTK.load_model()函数加载该模型。我正在查看CNTK git repo上的MNIST Tutorial,作为模型评估代码的参考。我创建了一个数据读取器(它是一个MinibatchSource对象),并尝试运行model.eval(mb),其中mb = minibatch_source.next_minibatch(...)(类似于this answer)
但是,我收到以下错误消息Traceback (most recent call last):
File "LID_test.py", line 162, in
test_and_evaluate()
File "LID_test.py", line 159, in test_and_evaluate
predictions = model.eval(mb)
File "/home/t-asbahe/anaconda3/envs/cntk-py35/lib/python3.5/site-packages/cntk/ops/functions.py", line 228, in eval
_, output_map = self.forward(arguments, self.outputs, device=device, as_numpy=as_numpy)
File "/home/t-asbahe/anaconda3/envs/cntk-py35/lib/python3.5/site-packages/cntk/utils/swig_helper.py", line 62, in wrapper
result = f(*args, **kwds)
File "/home/t-asbahe/anaconda3/envs/cntk-py35/lib/python3.5/site-packages/cntk/ops/functions.py", line 354, in forward
None, device)
File "/home/t-asbahe/anaconda3/envs/cntk-py35/lib/python3.5/site-packages/cntk/utils/__init__.py", line 393, in sanitize_var_map
if len(arguments) < len(op_arguments):
TypeError: object of type 'Variable' has no len()
我的模型中没有名为'Variable'的input_variable,我看不出有任何理由得到这个错误。在
注:我的输入是稀疏输入(one hots)