Code Monkey home page Code Monkey logo

attendance-using-face's Introduction

Face_recognition_attendance_system

The Basic Approach

This is my attempt to make a Face recognition system for classroom or office attendance. The system is based on a special type of cnn architecture known as a siamese network. Such a network is trained to generate a very accurate and almost unique 128 vector given that the images of face which a are fed to the network are properly aligned and cropped.
Then another dense neural network is trained taking input these embeddings. The second neural network is only for classification purposes. Then the person who is identified by the system, his/her attendance in the system is incremented by 1.
When the system is closed, a excel file consisting of attendance of all the students is generated.

maxresdefault taken from DeepLearning.ai.
You can watch these videos. Professor Andrew Ng gives an excellent explanation to these networks.

Embedding Generator

I have download the pretrained facenet model from nyoki-mtl githubu
This network is pretrained on a pretty large dataset, and produces a unique 128 dimensional vector for a particular face given the images fed to it are cropped to only the face region and are alligned. The input size of image for this netowrk is 160X160X3

Face Detection

Face detection is acheived by using haar cascades of opencv. Face detection haarcascade is used to detect the face and this detected region is fed to the embedding generator.

The second neural net

The second neural network has a dense architecture and is used for classification. The second neural network take input the 128 dimensional vector and ouputs the probability of the face to be one of the student.The architecture of the second neural network is screenshot from 2018-09-26 17-57-00

Updation of attendance

The database used is mongodb. Pymongo is used to add, delete records and also increment the attendance of the particular student. mongodb

csv file generation

After the application is closed, an excel file is generated. This excel file contains the attendance of all the student.

Requiremnents

Installing the requirements

  1. Start your terminal of cmd depending on your os.

  2. If you have a NVidia GPU then make sure you have the prerequisites for Tensorflow GPU installation (Refer to official site). Then use this commmand

    pip install -r requirements_gpu.txt

  3. In case you do not have a GPU then use this command

pip install -r requirements_cpu.txt

Apart from all this you also have to install mongodb in your system.

Want to run it on your own

1)Install all the requirements

2)Make a folder named "people" without quotes

3)Now run Generating_training_data.py, when this runs enter the name of the person followed by a index beginning from zero for example, if I want to generate data for "ravi", I will write "ravi0" and for the next name write "secondname1", just make sure the index given to everybody is in increasing order. Now put all this folders into the people folder

screenshot from 2018-09-26 18-00-10

4)Now in trainer.py change the number of classes according to number of folder and then run trainer.py

5)The model will be trained.

6)Now create a database using mongodb. Enter all the names with their attendance. This can be acheived by
a)create a data base named "new"
b)create a collection named "pa"
c)add the enteries. For eg db.pa.insert({"name":"satinder","attendance":0})

screenshot from 2018-09-26 18-02-31

7)Now open recognizer.py and change the dictionary "a" and people according to your data. The key of array "a" is the index of the people and the data is a indicating variable which is used to indicate that in a particular session, if the person attendance has been taken.

8)Dictionary "people" is self explanatory.

9)Run recognizer.py to recognize people. Their attendance will be registered in the mongodb database.

Results

screenshot from 2018-09-26 17-51-03

Updated attendance in the database

screenshot from 2018-09-26 17-51-17

Liked it

If you liked it you will surely like my other repos as well. You can also have a look at my youtube channel "reactor science". If you have any doubts you can contact me on my facebook page "reactor science"

References

1)Deep learning with python by Francois Chollet
2)keras.io
3)Deeplearning.ai by coursera(prof Andrew Ng)
4)CS231n by stanford
5)Pyimagesearch.com(Adrian Rosenberg)
6)Brandon Amos(github:https://github.com/bamos)

attendance-using-face's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

attendance-using-face's Issues

Not able to run trainer.py

When I'm running trainer.py on Pycharm it is showing

Using TensorFlow backend.
2018-10-05 15:20:41.521166: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Traceback (most recent call last):
File "trainer.py", line 13, in
e=emb()
File "C:\Users\Admin\Desktop\Programs\Attendance face recognition\Attendance-using-Face-master\Attendance-using-Face-master\embedding.py", line 5, in init
self.model=load_model('facenet_keras.h5')
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\engine\saving.py", line 419, in load_model
model = _deserialize_model(f, custom_objects, compile)
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\engine\saving.py", line 225, in deserialize_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\engine\saving.py", line 458, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\layers_init
.py", line 55, in deserialize
printable_module_name='layer')
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\utils\generic_utils.py", line 145, in deserialize_keras_object
list(custom_objects.items())))
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\engine\network.py", line 1032, in from_config
process_node(layer, node_data)
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\engine\network.py", line 991, in process_node
layer(unpack_singleton(input_tensors), **kwargs)
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\engine\base_layer.py", line 457, in call
output = self.call(inputs, **kwargs)
File "C:\Users\Admin\PycharmProjects\untitled\venv\lib\site-packages\keras\layers\core.py", line 687, in call
return self.function(inputs, **arguments)
File "../code/facenet_keras_v1.py", line 90, in
IndexError: tuple index out of range

Please resolve the issue
NOTE: I am running this on windows 10 and does not have GPU.

Error related loading model facenet_keras.h5

Hey satinder147,

First of all thank you very much for open sourcing such a good repo !!!

I am facing a small problem in loading this facenet_keras.h5, is i am only facing the problem..

Traceback (most recent call last):
File "e:/arm/Attendance-using-Face-master/trainer.py", line 13, in
e=emb()
File "e:\arm\Attendance-using-Face-master\embedding.py", line 5, in init
self.model=load_model('facenet_keras.h5')
File "C:\Users\snehm\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\saving.py", line 260, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "C:\Users\snehm\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\saving.py", line 334, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "C:\Users\snehm\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\layers_init_.py", line 55, in deserialize
printable_module_name='layer')
File "C:\Users\snehm\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\utils\generic_utils.py", line 145, in deserialize_keras_object
list(custom_objects.items())))
File "C:\Users\snehm\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\network.py", line 1027, in from_config
process_node(layer, node_data)
File "C:\Users\snehm\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\network.py", line 986, in process_node
layer(unpack_singleton(input_tensors), **kwargs)
File "C:\Users\snehm\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\base_layer.py", line 457, in call
output = self.call(inputs, **kwargs)
File "C:\Users\snehm\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\layers\core.py", line 682, in call
return self.function(inputs, **arguments)
File "../code/facenet_keras_v1.py", line 90, in
IndexError: tuple index out of range

TL;TR - Error in model

ValueError: bad marshal data (unknown type code)

Traceback (most recent call last):
File "C:\Users\arnol\Desktop\Attendance-using-Face-master\trainer.py", line 12, in
e = emb()
File "C:\Users\arnol\Desktop\Attendance-using-Face-master\embedding.py", line 5, in init
self.model=load_model('facenet_keras.h5')
File "C:\Python 3.9\lib\site-packages\keras\saving\save.py", line 201, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects,
File "C:\Python 3.9\lib\site-packages\keras\saving\hdf5_format.py", line 180, in load_model_from_hdf5
model = model_config_lib.model_from_config(model_config,
File "C:\Python 3.9\lib\site-packages\keras\saving\model_config.py", line 59, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "C:\Python 3.9\lib\site-packages\keras\layers\serialization.py", line 159, in deserialize
return generic_utils.deserialize_keras_object(
File "C:\Python 3.9\lib\site-packages\keras\utils\generic_utils.py", line 668, in deserialize_keras_object
deserialized_obj = cls.from_config(
File "C:\Python 3.9\lib\site-packages\keras\engine\training.py", line 2332, in from_config
functional.reconstruct_from_config(config, custom_objects))
File "C:\Python 3.9\lib\site-packages\keras\engine\functional.py", line 1274, in reconstruct_from_config
process_layer(layer_data)
File "C:\Python 3.9\lib\site-packages\keras\engine\functional.py", line 1256, in process_layer
layer = deserialize_layer(layer_data, custom_objects=custom_objects)
File "C:\Python 3.9\lib\site-packages\keras\layers\serialization.py", line 159, in deserialize
return generic_utils.deserialize_keras_object(
File "C:\Python 3.9\lib\site-packages\keras\utils\generic_utils.py", line 668, in deserialize_keras_object
deserialized_obj = cls.from_config(
File "C:\Python 3.9\lib\site-packages\keras\layers\core.py", line 1001, in from_config
function = cls._parse_function_from_config(
File "C:\Python 3.9\lib\site-packages\keras\layers\core.py", line 1053, in _parse_function_from_config
function = generic_utils.func_load(
File "C:\Python 3.9\lib\site-packages\keras\utils\generic_utils.py", line 783, in func_load
code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)

test function error

File "recognizer.py", line 28, in test
test_run=e.calculate(test_run)
File "C:\Users\Aditya\Attendance-using-Face-master\embedding.py", line 7, in calculate
return self.model.predict(img)[0]

i have a problem.if i run python3.6 recognizer.py

python3.6 recognizer.py
Using TensorFlow backend.
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-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_resource = np.dtype([("resource", np.ubyte, 1)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: 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)])
/home/hueintsystem2/.local/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: 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)])
2019-09-20 15:52:52.747509: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-09-20 15:52:52.767943: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2904000000 Hz
2019-09-20 15:52:52.768131: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4631790 executing computations on platform Host. Devices:
2019-09-20 15:52:52.768169: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): ,
2019-09-20 15:52:52.774210: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set. If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU. To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
WARNING:tensorflow:From /home/hueintsystem2/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:4070: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

/home/hueintsystem2/.local/lib/python3.6/site-packages/keras/engine/saving.py:341: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually.
warnings.warn('No training configuration found in save file: '
attendance till now is
Traceback (most recent call last):
File "recognizer.py", line 20, in
model=load_model('inception.MODEL')
File "/home/hueintsystem2/.local/lib/python3.6/site-packages/keras/engine/saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)
File "/home/hueintsystem2/.local/lib/python3.6/site-packages/keras/engine/saving.py", line 583, in load_model
with H5Dict(filepath, mode='r') as h5dict:
File "/home/hueintsystem2/.local/lib/python3.6/site-packages/keras/utils/io_utils.py", line 191, in init
self.data = h5py.File(path, mode=mode)
File "/home/hueintsystem2/.local/lib/python3.6/site-packages/h5py/_hl/files.py", line 408, in init
swmr=swmr)
File "/home/hueintsystem2/.local/lib/python3.6/site-packages/h5py/_hl/files.py", line 173, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 88, in h5py.h5f.open
OSError: Unable to open file (unable to open file: name = 'inception.MODEL', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

cv2.error to run recognier.py

Using TensorFlow backend.
2019-01-02 18:27:34.693326: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
/home/deepak/PycharmProjects/MLProjects/Attendance-using-Face-master/venv/lib/python3.6/site-packages/keras/engine/saving.py:292: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually.
warnings.warn('No training configuration found in save file: '
attendance till now is
Traceback (most recent call last):
File "recognizer.py", line 34, in
test()
File "recognizer.py", line 24, in test
test_run = cv2.resize(test_run, (160, 160)).astype('uint8')
cv2.error: OpenCV(3.4.5) /io/opencv/modules/imgproc/src/resize.cpp:3784: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

trainer.py not running

It shows errors when I try to run the trainer file. Could you please help? I am trying to run it on windows 10

Two errors

  1. y_train=to_categorical(y_train,num_classes=n_classes) // y = np.array(y, dtype='int') ValueError: invalid literal for int() with base 10:

  2. for x in people:
    #print(x)
    for i in os.listdir('people/'+x):
    #print(i)
    img=cv2.imread('people'+'/'+x+'/'+i,1)
    img=cv2.resize(img,(160,160))
    img=img.astype('float')/255.0
    img=np.expand_dims(img,axis=0)
    embs=e.calculate(img)
    #print(embs)
    x_data.append(embs)
    y_data.append(x) . should be likne

no training model found

C:\Users\Aditya\Anaconda3\envs\myenv\lib\site-packages\keras\engine\saving.py:292: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually.
warnings.warn('No training configuration found in save file: '
attendance till now is
Rahul 0.0
Gora 0.0
Traceback (most recent call last):
File "recognizer.py", line 35, in
test()
File "recognizer.py", line 25, in test
test_run=cv2.resize(test_run,(160,160))
cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

Dash ploty

How we can create dash ploty graph and chart make some daily based reports??

test() in recognizer.py not working properly

File "recognizer.py", line 35, in
test()
File "recognizer.py", line 28, in test
test_run=e.calculate(test_run)
File "C:\Users\Aditya\Attendance-using-Face-master\embedding.py", line 7, in calculate
return self.model.predict(img)[0]
File "C:\Users\Aditya\Anaconda3\envs\myenv\lib\site-packages\keras\engine\training.py", line 1169, in predict
steps=steps)
File "C:\Users\Aditya\Anaconda3\envs\myenv\lib\site-packages\keras\engine\training_arrays.py", line 294, in predict_loop
batch_outs = f(ins_batch)
File "C:\Users\Aditya\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py", line 2715, in call
return self._call(inputs)
File "C:\Users\Aditya\Anaconda3\envs\myenv\lib\site-packages\keras\backend\tensorflow_backend.py", line 2675, in _call
fetched = self._callable_fn(*array_vals)
File "C:\Users\Aditya\Anaconda3\envs\myenv\lib\site-packages\tensorflow\python\client\session.py", line 1439, in call
run_metadata_ptr)
File "C:\Users\Aditya\Anaconda3\envs\myenv\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
[[{{node Conv2d_1a_3x3/convolution}} = Conv2D[T=DT_FLOAT, _class=["loc:@Conv2d_1a_3x3_BatchNorm/cond/FusedBatchNorm/Switch"], data_format="NCHW", dilations=[1, 1, 1, 1], padding="VALID", strides=[1, 1, 2, 2], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Conv2d_1a_3x3/convolution-0-TransposeNHWCToNCHW-LayoutOptimizer, Conv2d_1a_3x3/kernel/read)]]
[[{{node Bottleneck_BatchNorm/cond/Merge/_4101}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="e

Segmentation Fault error while training

python3 trainer.py
/usr/local/lib/python3.5/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
2018-09-29 14:45:54.055259: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-09-29 14:45:54.164054: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-09-29 14:45:54.164338: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:01:00.0
totalMemory: 7.92GiB freeMemory: 7.51GiB
2018-09-29 14:45:54.164356: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1423] Adding visible gpu devices: 0
2018-09-29 14:45:54.338994: I tensorflow/core/common_runtime/gpu/gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-09-29 14:45:54.339031: I tensorflow/core/common_runtime/gpu/gpu_device.cc:917] 0
2018-09-29 14:45:54.339037: I tensorflow/core/common_runtime/gpu/gpu_device.cc:930] 0: N
2018-09-29 14:45:54.339226: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7254 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
Segmentation fault (core dumped)

research_centre_gpu@GPU:~/Attendance-using-Face-master$ python trainer.py
/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Traceback (most recent call last):
File "trainer.py", line 13, in
e=emb()
File "/home/research_centre_gpu/Attendance-using-Face-master/embedding.py", line 5, in init
self.model=load_model('facenet_keras.h5')
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/engine/saving.py", line 260, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/engine/saving.py", line 334, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/layers/init.py", line 55, in deserialize
printable_module_name='layer')
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/utils/generic_utils.py", line 145, in deserialize_keras_object
list(custom_objects.items())))
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/engine/network.py", line 1017, in from_config
process_layer(layer_data)
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/engine/network.py", line 1003, in process_layer
custom_objects=custom_objects)
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/layers/init.py", line 55, in deserialize
printable_module_name='layer')
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/utils/generic_utils.py", line 145, in deserialize_keras_object
list(custom_objects.items())))
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/layers/core.py", line 730, in from_config
function = func_load(config['function'], globs=globs)
File "/home/research_centre_gpu/miniconda2/lib/python2.7/site-packages/keras/utils/generic_utils.py", line 235, in func_load
code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)

Also we removed the file pycache to remove the error ->ValueError: bad marshal data (unknown type code) and we successfully removed it but still facing the same issue.

Please help me to find the solution for this issue.
Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.