faceNet编译问题

1.执行align_dataset_mtcnn.py出现无法导入检测模型的问题

a.现象如下

Creating networks and loading parameters
Traceback (most recent call last):
  File "./src/align/align_dataset_mtcnn.py", line 146, in <module>
    main(parse_arguments(sys.argv[1:]))
  File "./src/align/align_dataset_mtcnn.py", line 58, in main
    pnet, rnet, onet = align.detect_face.create_mtcnn(sess, None)
  File "/home/xxx/eclipsews/tflearning/src/facenet/src/align/detect_face.py", line 285, in create_mtcnn
    pnet.load(os.path.join(model_path, 'det1.npy'), sess)
  File "/home/xxx/eclipsews/tflearning/src/facenet/src/align/detect_face.py", line 87, in load
    data_dict = np.load(data_path, encoding='latin1').item() #pylint: disable=no-member
TypeError: load() got an unexpected keyword argument 'encoding'

b.原因

安装的numpython的load函数没有指定编码的参数:encoding='latin1

c.解决办法

将文件detect_face.py的87行做修改,修改如下:

data_dict = np.load(data_path, encoding='latin1').item() #pylint: disable=no-member

改为

data_dict = np.load(data_path).item() #pylint: disable=no-member

 

posted @ 2017-04-27 17:07  horsetail  阅读(3053)  评论(0编辑  收藏  举报