import scipy.io as sio
import numpy as np
import json
import cv2
import lmdb
import caffe
import os.path
import struct
#LMDB:Lightning Memory-MAPPed Database Manager 闪电般的内存数据库管理器,而不是肢,臂的意思。
def writeLMDB(datasets, lmdb_path, validation):
env = lmdb.open(lmdb_path, map_size=int(1e12))
txn = env.begin(write=True)
data = []
......
......
(caffe_env_cpm) feng@linux:~/my_prog/convolutional-pose-machines-release/training$ ls
genJSON.m genLMDB.py genProto.py json padded_img.jpg util
(caffe_env_cpm) feng@linux:~/my_prog/convolutional-pose-machines-release/training$ python genLMDB.py
File "genLMDB.py", line 9
SyntaxError: Non-ASCII character '\xe9' in file genLMDB.py on line 9, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
(caffe_env_cpm) feng@linux:~/my_prog/convolutional-pose-machines-release/training$
这里的错误就是,第9行注释中加入了中文,把中文删去即可解决问题。