ovalery16 / gender-age-classification Goto Github PK
View Code? Open in Web Editor NEWgender/age classification
License: Mozilla Public License 2.0
gender/age classification
License: Mozilla Public License 2.0
Hi,
Please help.
Getting error on:
loaded_model = model_from_json(loaded_model_json{"tf": tf})
Thanks.
Thank you for a wonderful code.
I confirmed the operation in the following environment.
All model data has been set up.
When executing the source code, the following error is displayed.
code = marshal.loads (raw_code)
ValueError: bad marshal data (unknown type code)
I tried deleting the pyc file, but it made no sense.
I want to know the version of Keras and Python used by this repository.
when I run python prediction_age_gender.py the code is automatically terminating
ype
.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
/home/ubuntu/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/matplotlib/init.py:1067: UserWarning: Duplicate key in file "/home/ubuntu/.config/matplotlib/matplotlibrc", line #2
(fname, cnt))
/home/ubuntu/anaconda3/envs/tensorflow_p27/lib/python2.7/site-packages/matplotlib/init.py:1067: UserWarning: Duplicate key in file "/home/ubuntu/.config/matplotlib/matplotlibrc", line #3
(fname, cnt))
2018-05-03 11:04:22.032230: 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-05-03 11:04:29.405064: W tensorflow/core/framework/allocator.cc:101] Allocation of 47185920 exceeds 10% of system memory.
2018-05-03 11:04:29.548531: W tensorflow/core/framework/allocator.cc:101] Allocation of 37748736 exceeds 10% of system memory.
2018-05-03 11:04:29.658489: W tensorflow/core/framework/allocator.cc:101] Allocation of 37748736 exceeds 10% of system memory.
2018-05-03 11:04:29.788885: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:29.849619: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:29.914232: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.045267: W tensorflow/core/framework/allocator.cc:101] Allocation of 47185920 exceeds 10% of system memory.
2018-05-03 11:04:30.135313: W tensorflow/core/framework/allocator.cc:101] Allocation of 37748736 exceeds 10% of system memory.
2018-05-03 11:04:30.157469: W tensorflow/core/framework/allocator.cc:101] Allocation of 37748736 exceeds 10% of system memory.
2018-05-03 11:04:30.178977: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.189230: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.200952: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.237024: W tensorflow/core/framework/allocator.cc:101] Allocation of 37748736 exceeds 10% of system memory.
2018-05-03 11:04:30.272587: W tensorflow/core/framework/allocator.cc:101] Allocation of 47185920 exceeds 10% of system memory.
2018-05-03 11:04:30.394171: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.453613: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.499271: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.520698: W tensorflow/core/framework/allocator.cc:101] Allocation of 37748736 exceeds 10% of system memory.
2018-05-03 11:04:30.742592: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.770523: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.783489: W tensorflow/core/framework/allocator.cc:101] Allocation of 18874368 exceeds 10% of system memory.
2018-05-03 11:04:30.789356: W tensorflow/core/framework/allocator.cc:101] Allocation of 37748736 exceeds 10% of system memory.
2018-05-03 11:04:30.789426: W tensorflow/core/framework/allocator.cc:101] Allocation of 37748736 exceeds 10% of system memory.
2018-05-03 11:04:30.789451: W tensorflow/core/framework/allocator.cc:101] Allocation of 47185920 exceeds 10% of system memory.
Killed
`
Your code is tested with pyhton2.7 and the model was saved with 2.7, but when tried to run it with python3.5, I got his error:
Traceback (most recent call last):
File "d:\Program Files\Anaconda3\lib\site-packages\keras\utils\generic_utils.py", line 230, in func_load
raw_code = codecs.decode(code.encode('ascii'), 'base64')
UnicodeEncodeError: 'ascii' codec can't encode character '\x83' in position 37: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Face\FaceAttribute\gender-age-classification-master\demo.py", line 21, in
loaded_model = model_from_json(loaded_model_json, custom_objects={"tf": tf})
File "d:\Program Files\Anaconda3\lib\site-packages\keras\engine\saving.py", line 368, in model_from_json
return deserialize(config, custom_objects=custom_objects)
File "d:\Program Files\Anaconda3\lib\site-packages\keras\layers_init_.py", line 55, in deserialize
printable_module_name='layer')
File "d:\Program Files\Anaconda3\lib\site-packages\keras\utils\generic_utils.py", line 145, in deserialize_keras_object
list(custom_objects.items())))
File "d:\Program Files\Anaconda3\lib\site-packages\keras\engine\network.py", line 1017, in from_config
process_layer(layer_data)
File "d:\Program Files\Anaconda3\lib\site-packages\keras\engine\network.py", line 1003, in process_layer
custom_objects=custom_objects)
File "d:\Program Files\Anaconda3\lib\site-packages\keras\layers_init_.py", line 55, in deserialize
printable_module_name='layer')
File "d:\Program Files\Anaconda3\lib\site-packages\keras\utils\generic_utils.py", line 145, in deserialize_keras_object
list(custom_objects.items())))
File "d:\Program Files\Anaconda3\lib\site-packages\keras\engine\network.py", line 1017, in from_config
process_layer(layer_data)
File "d:\Program Files\Anaconda3\lib\site-packages\keras\engine\network.py", line 1003, in process_layer
custom_objects=custom_objects)
File "d:\Program Files\Anaconda3\lib\site-packages\keras\layers_init_.py", line 55, in deserialize
printable_module_name='layer')
File "d:\Program Files\Anaconda3\lib\site-packages\keras\utils\generic_utils.py", line 145, in deserialize_keras_object
list(custom_objects.items())))
File "d:\Program Files\Anaconda3\lib\site-packages\keras\layers\core.py", line 730, in from_config
function = func_load(config['function'], globs=globs)
File "d:\Program Files\Anaconda3\lib\site-packages\keras\utils\generic_utils.py", line 235, in func_load
code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)
Thanks. Which dataset was used for training the pretrained model? Also, please provide details regarding iarchitecture used. Is it inception_v3?
in your utils.py
temp=array( listPrediction[i][3])
IndexError: list index out of range
I tried to let it run with a usb camera. But it runs slowly and when I want to quit, after pressed Ctrl+C, the screen freezes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.