AttributeError: module 'sklearn' has no attribute 'preprocessing'

AttributeError: module 'sklearn' has no attribute 'preprocessing'

literature
2023-08-26 / 0 评论 / 265 阅读 / 正在检测是否收录...

源代码(报错):

import sklearn
 
.......
 
embedding = sklearn.preprocessing.normalize(embedding).flatten()

修改为(正常运行):

from sklearn import preprocessing
 
...........

embedding = preprocessing.normalize(embedding).flatten()
0

评论

博主关闭了当前页面的评论