arunponnusamy / gender-detection-keras

Gender detection (from scratch) using deep learning with keras and cvlib.
http://arunponnusamy.com
MIT License
184 stars 68 forks source link

gender_dataset.model #22

Open ashokkumarsam opened 4 years ago

ashokkumarsam commented 4 years ago

Hi, Thank you for providing such a nice script to work with gender prediction. I am able to generate the gender_dataset.model file from my own dataset by using train.py. After generating the model,i am using it in pre-dataset folder to check the accurate and running the detect_gender_webcam.py script to predict the gender from video. While running the script with my own dataset model it is throwing error like as below.

'''Using TensorFlow backend. C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:469: 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)]) C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:470: 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)]) C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:471: 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)]) C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:472: 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)]) C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:473: 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)]) C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\dtypes.py:476: 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)]) Traceback (most recent call last): File "C:\Users\Ashok\computer vision\threshold gender\detect_gender_webcam.py", line 20, in model = load_model(model_path) File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 270, in load_model model = model_from_config(model_config, custom_objects=custom_objects) File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 347, in model_from_config return layer_module.deserialize(config, custom_objects=custom_objects) File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\layers__init__.py", line 55, in deserialize printable_module_name='layer') File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\generic_utils.py", line 144, in deserialize_keras_object list(custom_objects.items()))) File "C:\Users\Ashok\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 1406, in from_config if 'class_name' not in config[0] or config[0]['class_name'] == 'Merge': KeyError: 0 ''' Can you please guide me how to resolve this issue.

shivangbajaj commented 4 years ago

Can you help me with training the dataset? Which dataset did you use