代码:

在python3.x下使用如下代码:

test_data = zip(test_inputs, te_d[1])
n_test = len(test_data)

错误:

object of type 'zip' has no len()

原因:

python2与python3的不同

解决办法:
先把zip转成list再求len

test_data = list(zip(test_inputs, te_d[1]))
n_test = len(test_data)

results matching ""

    No results matching ""