我收到错误TypeError:无法解包不可迭代的NoneType对象

def error(m,x,c,t):
N=x.size
e=sum(((m*x+c)-t)**2)
return e* 1/(2*N)

xtrain,xtest,ytrain,ytest = train_test_split(X,Y,test_size = 0.2)

def update(m,x,c,t,learning_rate):
grad_m=sum(2*((m*x+c)-t)*x)
grad_c=sum(2*((m*x+c)-t))
m=m-grad_m * learning_rate
c=c-grad_c * learning_rate
return m,c

init_m=0.9

init_c = 0

learning_rate = 0.001

迭代次数= 100

error_threshold = 0.001

m,c,error_values,mc_values =梯度下降(init_m,init_c,xtrain,ytrain,learning_rate,迭代次数,error_threshold)

TypeError                              追溯(最近一次通话)  在

 5
 6 error_threshold=0.001  

----> 7 m,c,error_values,mc_values =梯度下降(init_m,init_c,xtrain,ytrain,learning_rate,iterations,error_threshold)

TypeError:无法解压缩不可迭代的NoneType对象