win7 python3.6运行命令后,出现PermissionError:[Errno 13] Permission denied: 'd:/picture/origin'
win7python3.6运行以下命令pythonSearch.py-id:/picture/origin-qd:/picture/q/1.jpg-rd:/picture...
win7 python3.6运行以下命令
python Search.py -i d:/picture/origin -q d:/picture/q/1.jpg -r d:/picture/test
运行后,出现PermissionError:[Errno 13] Permission denied: 'd:/picture/origin'
请问如何解决?我已经把cmd.exe设置为管理员权限,并且把python3.6.exe全部设置为获取管理员权限!
class Searcher:
def __init__(self, indexPath):
self.indexPath = indexPath
def search(self, queryFeatures, limit=10):
results = {}
# open the index file for reading
with open(self.indexPath) as f:
# initialize the CSV reader
reader = csv.reader()
# loop over the rows in the index
for row in reader:
# parse out the imageID and features,
# then compute the chi-squared distance
features = [float(x) for x in row[1:]]
d = self.chi2_distance(features, queryFeatures)
results[row[0]] = d
f.close()
results = sorted([(v,k) for (k,v) in results.items()])
return results[:limit]
def chi2_distance(self, histA, histB, eps=1e-10):
# compute the chi-squred distance
d = 0.5*np.sum([((a-b)**2)/(a+b+eps) for(a,b) in zip(histA,histB)])
return d 展开
python Search.py -i d:/picture/origin -q d:/picture/q/1.jpg -r d:/picture/test
运行后,出现PermissionError:[Errno 13] Permission denied: 'd:/picture/origin'
请问如何解决?我已经把cmd.exe设置为管理员权限,并且把python3.6.exe全部设置为获取管理员权限!
class Searcher:
def __init__(self, indexPath):
self.indexPath = indexPath
def search(self, queryFeatures, limit=10):
results = {}
# open the index file for reading
with open(self.indexPath) as f:
# initialize the CSV reader
reader = csv.reader()
# loop over the rows in the index
for row in reader:
# parse out the imageID and features,
# then compute the chi-squared distance
features = [float(x) for x in row[1:]]
d = self.chi2_distance(features, queryFeatures)
results[row[0]] = d
f.close()
results = sorted([(v,k) for (k,v) in results.items()])
return results[:limit]
def chi2_distance(self, histA, histB, eps=1e-10):
# compute the chi-squred distance
d = 0.5*np.sum([((a-b)**2)/(a+b+eps) for(a,b) in zip(histA,histB)])
return d 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询