BoyuanJiang/Age-Gender-Estimate-TF

unable to run test.py

Opened this issue · 6 comments

Hello,
Recently I am trying to run your code to detect the age and gender. However, when I use python test.py --images "./data/test" --model_path "./models" --batch_size 128 --choose_best --cuda to test the images, there are something wrong.
Following are the wrong messages:

Traceback (most recent call last):
File "test.py", line 108, in
args.batch_size)
File "test.py", line 89, in main
batch_size)
File "test.py", line 77, in choose_best_model
ckpt.all_model_checkpoint_paths[idx], )
File "test.py", line 63, in test_once
coord.join(threads)
File "/home/happyforever/.local/lib/python2.7/site-packages/tensorflow/python/training/coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "/home/happyforever/.local/lib/python2.7/site-packages/tensorflow/python/training/queue_runner_impl.py", line 238, in _run
enqueue_callable()
File "/home/happyforever/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1231, in _single_operation_run
target_list_as_strings, status, None)
File "/home/happyforever/.local/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.DataLossError: corrupted record at 0
[[Node: input/ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/device:CPU:0"](input/TFRecordReaderV2, input/input_producer)]]
[[Node: input/ParseSingleExample/ParseExample/ParseExample/_995 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_18_input/ParseSingleExample/ParseExample/ParseExample", tensor_type=DT_INT64, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]

And while I test your model with your python eval.py --I "./demo/demo.jpg" --M "./models/" --font_scale 1 --thickness 1 without changing your demo.jpg, there are some errors as well.

Traceback (most recent call last):
File "eval.py", line 97, in
aligned_image, image, rect_nums, XY = load_image(args.image_path, args.shape_detector)
File "eval.py", line 45, in load_image
predictor = dlib.shape_predictor(shape_predictor)
RuntimeError: Error deserializing object of type int64
while deserializing a floating point number.
while deserializing a dlib::matrix
while deserializing object of type std::vector
while deserializing object of type std::vector
while deserializing object of type std::vector

Could you tell me what's wrong? Thank you!

Hello,
For the first question, from the error above, it seems that your test datasets have some problems(I am not very sure).
tensorflow.python.framework.errors_impl.DataLossError: corrupted record at 0
For the second question, it may be the file shape_predictor_68_face_landmarks.dat you download is corrupt, see this or this, you can try to re-download it and unzip it.

tensorflow.python.framework.errors_impl.DataLossError: corrupted record at 0
Can you help me share sample test datasets? Thanks you.

Sorry for that all tfrecords dataset have been deleted, you can create the tfrecord refer to it.

@BoyuanJiang thank you so much 👍

thank you so much

hi i have this issue about dlib installation:

Invoking CMake setup: 'cmake C:\Users\fguerouali\AppData\Local\Temp\pycharm-packaging\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\fguerouali\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win-amd64-3.6 -DPYTHON_EXECUTABLE=C:\Users\fguerouali\AppData\Local\Programs\Python\Python36\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\fff\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win-amd64-3.6 -A x64'
-- Building for: NMake Makefiles
CMake Error in CMakeLists.txt:
Generator

    NMake Makefiles

  does not support platform specification, but platform

    x64

  was specified.