[英]error= ImportError: cannot import name 'comb'
#ImportError: cannot import name 'comb'
import scipy
from scipy.misc import comb
# Loading the vectorizer and classfier
with open('classifier.pickle','rb') as f:
classifier = pickle.load(f)
with open('tfidfmodel.pickle','rb') as f:
vectorizer = pickle.load(f)
both the files classifier.pickle and tfid.pickle as kept in same folder 文件classifier.pickle和tfid.pickle都保存在同一个文件夹中
This has nothing to do with the location of classifier
or vectorizer
( tfid
does not appear in your question). 这与
classifier
或vectorizer
的位置无关( tfid
没有出现在你的问题中)。 This is an import error, due to the fact that comb
was moved to scipy.special
. 这是一个导入错误,因为
comb
被移动到scipy.special
。 This would've been easy to find by googling "scipy.misc.comb" and seeing the result "scipy.special.comb" fairly high. 通过谷歌搜索“scipy.misc.comb”并且看到结果“scipy.special.comb”相当高,这很容易找到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.