sainimohit23 / FaceNet-Real-Time-face-recognition

66 stars 42 forks source link

Not able to train the model. The below Error occurs during training. #12

Closed somasundaram1702 closed 4 years ago

somasundaram1702 commented 4 years ago

Using TensorFlow backend. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) Saved model not found, loading untrained FaceNet 2020-07-15 20:28:37.952932: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2020-07-15 20:28:38.029719: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-07-15 20:28:38.030505: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1411] Found device 0 with properties: name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235 pciBusID: 0000:00:04.0 totalMemory: 11.17GiB freeMemory: 11.11GiB 2020-07-15 20:28:38.030543: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1490] Adding visible gpu devices: 0 2020-07-15 20:28:38.361742: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-07-15 20:28:38.361820: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] 0 2020-07-15 20:28:38.361839: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0: N 2020-07-15 20:28:38.361960: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1103] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10761 MB memory) -> physical GPU (device: 0, name: Tesla K80, pci bus id: 0000:00:04.0, compute capability: 3.7) Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 1626, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 1 but is rank 0 for 'bn1/cond/Reshape_4' (op: 'Reshape') with input shapes: [1,64,1,1], [].

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./FaceNet-train/train_triplet.py", line 49, in FRmodel = faceRecoModel(input_shape=(3, IMAGE_SIZE, IMAGE_SIZE)) File "/content/FaceNet-train/inception_blocks_v2.py", line 231, in faceRecoModel X = BatchNormalization(axis = 1, name = 'bn1')(X) File "/usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py", line 457, in call output = self.call(inputs, kwargs) File "/usr/local/lib/python3.6/dist-packages/keras/layers/normalization.py", line 206, in call training=training) File "/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py", line 3123, in in_train_phase x = switch(training, x, alt) File "/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py", line 3058, in switch else_expression_fn) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py", line 488, in new_func return func(*args, *kwargs) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2087, in cond orig_res_f, res_f = context_f.BuildCondBranch(false_fn) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 1920, in BuildCondBranch original_result = fn() File "/usr/local/lib/python3.6/dist-packages/keras/layers/normalization.py", line 167, in normalize_inference epsilon=self.epsilon) File "/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py", line 1908, in batch_normalization mean = tf.reshape(mean, (-1)) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 6296, in reshape "Reshape", tensor=tensor, shape=shape, name=name) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py", line 488, in new_func return func(args, kwargs) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3272, in create_op op_def=op_def) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 1790, in init control_input_ops) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 1629, in _create_c_op raise ValueError(str(e)) ValueError: Shape must be rank 1 but is rank 0 for 'bn1/cond/Reshape_4' (op: 'Reshape') with input shapes: [1,64,1,1],