Win10命令:
python src/align/align_dataset_mtcnn.py src/datasets/lfw/raw src/datasets/lfw/lfw_mtcnn_160 --image_size=160 --margin=32 --random_order
报错:
0 successful operations.
0 derived errors ignored.
Errors may have originated from an input operation.
Input Source operations connected to node pnet/conv1/Conv2D:
pnet/input (defined at E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py:282)
pnet/conv1/weights/read (defined at E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py:126)
Input Source operations connected to node pnet/conv1/Conv2D:
pnet/input (defined at E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py:282)
pnet/conv1/weights/read (defined at E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py:126)
Original stack trace for ‘pnet/conv1/Conv2D’:
File “src/compare.py”, line 127, in
main(parse_arguments(sys.argv[1:]))
File “src/compare.py”, line 41, in main
images = load_and_align_data(args.image_files, args.image_size, args.margin, args.gpu_memory_fraction)
File “src/compare.py”, line 90, in load_and_align_data
pnet, rnet, onet = align.detect_face.create_mtcnn(sess, None)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py”, line 283, in create_mtcnn
pnet = PNet({‘data’:data})
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py”, line 73, in init
self.setup()
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py”, line 220, in setup
.conv(3, 3, 10, 1, 1, padding=‘VALID’, relu=False, name=‘conv1’)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py”, line 51, in layer_decorated
layer_output = op(self, layer_input, *args, **kwargs)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py”, line 157, in conv
output = convolve(inp, kernel)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\Lib\site-packages\facenet\src\align\detect_face.py”, line 153, in
convolve = lambda i, k: tf.nn.conv2d(i, k, [1, s_h, s_w, 1], padding=padding)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\ops\nn_ops.py”, line 1953, in conv2d
name=name)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py”, line 1161, in conv2d
data_format=data_format, dilations=dilations, name=name)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\op_def_library.py”, line 788, in _apply_op_helper
op_def=op_def)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\util\deprecation.py”, line 507, in new_func
return func(*args, **kwargs)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\ops.py”, line 3616, in create_op
op_def=op_def)
File “E:\Users\TFX\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\ops.py”, line 2005, in init
self._traceback = tf_stack.extract_stack()
在原命令中加上 --gpu_memory_fraction=0.25,即
python src/align/align_dataset_mtcnn.py src/datasets/lfw/raw src/datasets/lfw/lfw_mtcnn_160 --image_size=160 --margin=32 --random_order --gpu_memory_fraction=0.25
就可以了。