您的位置:首页 > 其它

in predict assert self.binded and self.params_initialized AssertionError

2018-03-09 23:37 2361 查看
错误一:in predict     assert self.binded and self.params_initialized AssertionError  ###需要绑定data_shape
错误二:InferShape pass cannot decide shapes for the following arguments (0s means unknown dimensions). Please consider providing them as inputs:
softmax_label: (), ##提示需要绑定label_shape

    model = mx.mod.Module.load('symbol/ocr',100)
data_shape = [("data", (1, 3, 60, 60))]  #####问题一原因
label_shape=[("softmax_label",(1,))]    #####问题二原因
model.bind(data_shape,label_shape)    #####解决问题

#help(model)
res =  np.array(model.predict(val)[0])
print "预测结果为:%s" %(np.argmax(res))

添加##### 结尾的3句代码
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐