2018-01-24 修改py文件解決了人臉識別模型生成中需要顯卡的問題

python testBatchModel.py testBatchModel.txt ../data/robert/

Prepare image ../data/paper/imgs/test3dfacedetection.jpg:
Number of faces detected: 1
CNN Model loaded to regress 3D Shape and Texture!
('> Processing image: ', '../data/robert//imgs/test3dfacedetection.png', ' ', 'test3dfacedetection.png', ' ', '1/1')
/root/anaconda2/lib/python2.7/site-packages/skimage/transform/warps.py:84: UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15.
warn("The default mode, 'constant', will be changed to 'reflect' in "
Regress bump maps
Traceback (most recent call last):
File "testBatchModel.py", line 183, in <module>
bumpMapRegressor.estimateBump(bumpModel_path, data_out + "/imList.txt", data_out + "/bump/")
File "/home/pythonhack/extreme_3d_faces-master/demoCode/bumpMapRegressor.py", line 336, in estimateBump
net.load_state_dict(torch.load(modelPath));
File "/root/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 261, in load
return load(f, map_location, pickle_module)
File "/root/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 409, in load
result = unpickler.load()
File "/root/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 380, in persistent_load
data_type(size), location)
File "/root/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 86, in default_restore_location
result = fn(storage, location)
File "/root/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 68, in cuda_deserialize
return obj.cuda(device)
File "/root/anaconda2/lib/python2.7/site-packages/torch/utils.py", line 61, in cuda
with torch.cuda.device(device):
File "/root/anaconda2/lib/python2.7/site-packages/torch/cuda/init.py", line 186, in enter
lazy_init()
File "/root/anaconda2/lib/python2.7/site-packages/torch/cuda/init.py", line 120, in lazy_init
check_driver()
File "/root/anaconda2/lib/python2.7/site-packages/torch/cuda/init.py", line 62, in check_driver
http://www.nvidia.com/Download/index.aspx""")
AssertionError:
Found no NVIDIA driver on your system. Please check that you
have an NVIDIA GPU and installed a driver from
http://www.nvidia.com/Download/index.aspx
Segmentation fault
[root@master@/home/pythonhack/extreme_3d_faces-master/demoCode@16:36:55]
2130 $ vi "/root/anaconda2/lib/python2.7/site-packages/torch/serialization.py"
[root@master@/home/pythonhack/extreme_3d_faces-master/demoCode@16:37:25]
2131 $ vi +68 "/root/anaconda2/lib/python2.7/site-packages/torch/serialization.py"
[root@master@/home/pythonhack/extreme_3d_faces-master/demoCode@16:37:48]
2132 $ python testBatchModel.py testBatchModel.txt ../data/robert/
Prepare image ../data/paper/imgs/test3dfacedetection.jpg:
Number of faces detected: 1
CNN Model loaded to regress 3D Shape and Texture!
('> Processing image: ', '../data/robert//imgs/test3dfacedetection.png', ' ', 'test3dfacedetection.png', ' ', '1/1')
/root/anaconda2/lib/python2.7/site-packages/skimage/transform/warps.py:84: UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15.
warn("The default mode, 'constant', will be changed to 'reflect' in "
Regress bump maps
['add', 'and', 'array', 'array_wrap', 'bool', 'class', 'deepcopy', 'delattr', 'delitem', 'dict', 'div', 'doc', 'eq', 'float', 'format', 'ge', 'getattribute', 'getitem', 'getstate', 'gt', 'hash', 'iadd', 'iand', 'idiv', 'ilshift', 'imul', 'init', 'int', 'invert', 'ior', 'ipow', 'irshift', 'isub', 'iter', 'itruediv', 'ixor', 'le', 'len', 'long', 'lshift', 'lt', 'matmul', 'mod', 'module', 'mul', 'ne', 'neg', 'new', 'nonzero', 'or', 'pow', 'radd', 'rdiv', 'reduce', 'reduce_ex', 'repr', 'rmul', 'rpow', 'rshift', 'rsub', 'rtruediv', 'setattr', 'setitem', 'setstate', 'sizeof', 'str', 'sub', 'subclasshook', 'truediv', 'weakref', 'xor', 'advanced_index_add', 'advanced_index_select', 'cdata', 'check_advanced_indexing', 'new_with_metadata_file', 'set_index', 'sparse_mask', 'torch', 'write_metadata', 'abs', 'abs', 'acos', 'acos', 'add', 'add', 'addbmm', 'addbmm', 'addcdiv', 'addcdiv', 'addcmul', 'addcmul', 'addmm', 'addmm', 'addmv', 'addmv', 'addr', 'addr', 'apply
', 'asin', 'asin
', 'atan', 'atan2', 'atan2
', 'atan
', 'baddbmm', 'baddbmm
', 'bernoulli', 'bernoulli
', 'bmm', 'btrifact', 'btrisolve', 'byte', 'cauchy
', 'ceil', 'ceil
', 'char', 'chunk', 'clamp', 'clamp
', 'clone', 'contiguous', 'copy
', 'cos', 'cos
', 'cosh', 'cosh_', 'cpu', 'cross', 'cuda', 'cumprod', 'cumsum', 'data', 'data_ptr', 'diag', 'dim', 'dist', 'div', 'div_', 'dot', 'double', 'eig', 'element_size', 'eq', 'eq_', 'equal', 'erf', 'erf_', 'erfinv', 'erfinv_', 'exp', 'exp_', 'expand', 'expand_as', 'exponential_', 'fill_', 'float', 'floor', 'floor_', 'fmod', 'fmod_', 'frac', 'frac_', 'gather', 'ge', 'ge_', 'gels', 'geometric_', 'geqrf', 'ger', 'gesv', 'gt', 'gt_', 'half', 'histc', 'index', 'index_add_', 'index_copy_', 'index_fill_', 'index_select', 'int', 'inverse', 'is_contiguous', 'is_cuda', 'is_pinned', 'is_same_size', 'is_set_to', 'is_shared', 'is_signed', 'is_sparse', 'kthvalue', 'le', 'le_', 'lerp', 'lerp_', 'lgamma', 'lgamma_', 'log', 'log1p', 'log1p_', 'log_', 'log_normal_', 'long', 'lt', 'lt_', 'map2_', 'map_', 'masked_copy_', 'masked_fill_', 'masked_scatter_', 'masked_select', 'matmul', 'max', 'mean', 'median', 'min', 'mm', 'mode', 'mul', 'mul_', 'multinomial', 'mv', 'narrow', 'ndimension', 'ne', 'ne_', 'neg', 'neg_', 'nelement', 'new', 'nonzero', 'norm', 'normal_', 'numel', 'numpy', 'orgqr', 'ormqr', 'permute', 'pin_memory', 'potrf', 'potri', 'potrs', 'pow', 'pow_', 'prod', 'pstrf', 'put_', 'qr', 'random_', 'reciprocal', 'reciprocal_', 'remainder', 'remainder_', 'renorm', 'renorm_', 'repeat', 'resize_', 'resize_as_', 'round', 'round_', 'rsqrt', 'rsqrt_', 'scatter_', 'scatter_add_', 'select', 'set_', 'shape', 'share_memory_', 'short', 'sigmoid', 'sigmoid_', 'sign', 'sign_', 'sin', 'sin_', 'sinh', 'sinh_', 'size', 'sort', 'split', 'sqrt', 'sqrt_', 'squeeze', 'squeeze_', 'std', 'storage', 'storage_offset', 'storage_type', 'stride', 'sub', 'sub_', 'sum', 'svd', 'symeig', 't', 't_', 'take', 'tan', 'tan_', 'tanh', 'tanh_', 'tolist', 'topk', 'trace', 'transpose', 'transpose_', 'tril', 'tril_', 'triu', 'triu_', 'trtrs', 'trunc', 'trunc_', 'type', 'type_as', 'unfold', 'uniform_', 'unsqueeze', 'unsqueeze_', 'var', 'view', 'view_as', 'zero_']
Recover the 3D models
cd ../bin; ./TestBump -batch ../data/robert//imList.txt ../data/robert//3D/ ../data/robert//shape ../data/robert//bump ../data/robert//bump ../3DMM_model/BaselFaceModel_mod.h5 ../dlib_model/shape_predictor_68_face_landmarks.dat ../data/robert//imgs; cd ../demoCode
load ../3DMM_model/BaselFaceModel_mod.h5
Process ../data/robert//imgs/test3dfacedetection.png
Process
sh: line 1: 23333 Segmentation fault ./TestBump -batch ../data/robert//imList.txt ../data/robert//3D/ ../data/robert//shape ../data/robert//bump ../data/robert//bump ../3DMM_model/BaselFaceModel_mod.h5 ../dlib_model/shape_predictor_68_face_landmarks.dat ../data/robert//imgs
Segmentation fault

注:盡管bash命令報(bào)錯(cuò) Segmentation fault,需要的ply文件還是生成了摩渺。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末饲宿,一起剝皮案震驚了整個(gè)濱河市侥猩,隨后出現(xiàn)的幾起案子冤竹,更是在濱河造成了極大的恐慌德挣,老刑警劉巖屁柏,帶你破解...
    沈念sama閱讀 218,204評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件怪嫌,死亡現(xiàn)場離奇詭異唤蔗,居然都是意外死亡探遵,警方通過查閱死者的電腦和手機(jī)窟赏,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,091評論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來箱季,“玉大人涯穷,你說我怎么就攤上這事〔爻” “怎么了拷况?”我有些...
    開封第一講書人閱讀 164,548評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長掘殴。 經(jīng)常有香客問我赚瘦,道長,這世上最難降的妖魔是什么奏寨? 我笑而不...
    開封第一講書人閱讀 58,657評論 1 293
  • 正文 為了忘掉前任起意,我火速辦了婚禮,結(jié)果婚禮上病瞳,老公的妹妹穿的比我還像新娘杜恰。我一直安慰自己,他們只是感情好仍源,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,689評論 6 392
  • 文/花漫 我一把揭開白布心褐。 她就那樣靜靜地躺著,像睡著了一般笼踩。 火紅的嫁衣襯著肌膚如雪逗爹。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,554評論 1 305
  • 那天嚎于,我揣著相機(jī)與錄音掘而,去河邊找鬼。 笑死于购,一個(gè)胖子當(dāng)著我的面吹牛袍睡,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播肋僧,決...
    沈念sama閱讀 40,302評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼斑胜,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了嫌吠?” 一聲冷哼從身側(cè)響起止潘,我...
    開封第一講書人閱讀 39,216評論 0 276
  • 序言:老撾萬榮一對情侶失蹤辫诅,失蹤者是張志新(化名)和其女友劉穎凭戴,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體炕矮,經(jīng)...
    沈念sama閱讀 45,661評論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡么夫,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,851評論 3 336
  • 正文 我和宋清朗相戀三年者冤,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片档痪。...
    茶點(diǎn)故事閱讀 39,977評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡涉枫,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出钞它,到底是詐尸還是另有隱情拜银,我是刑警寧澤,帶...
    沈念sama閱讀 35,697評論 5 347
  • 正文 年R本政府宣布遭垛,位于F島的核電站尼桶,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏锯仪。R本人自食惡果不足惜泵督,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,306評論 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望庶喜。 院中可真熱鬧小腊,春花似錦、人聲如沸久窟。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,898評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽斥扛。三九已至入问,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間稀颁,已是汗流浹背芬失。 一陣腳步聲響...
    開封第一講書人閱讀 33,019評論 1 270
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留匾灶,地道東北人棱烂。 一個(gè)月前我還...
    沈念sama閱讀 48,138評論 3 370
  • 正文 我出身青樓,卻偏偏與公主長得像阶女,于是被迫代替她去往敵國和親颊糜。 傳聞我的和親對象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,927評論 2 355

推薦閱讀更多精彩內(nèi)容