michalfaber / keras_Realtime_Multi-Person_Pose_Estimation

Keras version of Realtime Multi-Person Pose Estimation project
Other
779 stars 372 forks source link

['data'] object not found #32

Open j1mehta opened 6 years ago

j1mehta commented 6 years ago

Hi, I'm converting the dataset to the hdf5 format via generate_hdf5.py with a change that I decreased the num_samples to 4000. I did this because I'm running this on a VM which has 64 GB of disk space and runs out if I let it run through the normal no. However, when I run train_pose.py, it faces an error that "Unable to open object (object 'data' doesn't exist)". Face the same error when trying to run inspect_dataset.ipynb. Appreciate any pointers. Thank you!

michalfaber commented 6 years ago

It seems that you use DataIterator which is deprecated. Did you change the flag use_client_gen=False ?

j1mehta commented 6 years ago

Thank you for the super quick response. That's correct. I did that as an experiment to figure out how to extract the ground truth key points directly from the hdf5 file for that particular image. As I have realized, it's not possible to get the key points (from the metadata channel (4th channel?) of img) in the same form as I'd get from cocoAPI (anns = coco.loadAnns(annIds) coco.showAnns(anns)).

Thus, I'd just use the API for getting it, but I'm not sure how to obtain the image ID from the matrix obtained from hdf5 file which is of shape [width, height, 6] corresponding to which I can fetch the annotations.

michalfaber commented 6 years ago

Yes. image id may be useful in hdf5 file. It is a quite simple modification in the generate_hdf5.py:

        clidx = clidx + 1
        image_id = float2bytes(data[idx]['image_id'])
        for i in range(len(image_id)):
            meta_data[clidx][i] = image_id[i]

Also you would have to modify relevant part in the server DataTransformer::ReadMetaData. I will try to add those changes soon when I have some more time.

anatolix commented 6 years ago

hdf5 able to store native metadata, and attributes, for example here I add 'meta' attribute with json

https://github.com/anatolix/keras_Realtime_Multi-Person_Pose_Estimation/commit/dc6c0b725d983818f164374e101a6ddcce528a07#diff-d547a249c8d746c54188d57510a9db88

Serialising everything to picture it is quite strange solution from original caffe layer, my guess they were not able to read anything except image layers inside caffe, so the use this hack

Hubqindelhei commented 6 years ago

first thank you for sharing so cool code! i have an issue about read hdf5, that makes me me interruptted. After i run generate_hdf5.py, in my dataset folder generated two .h5 file. but when i began to train, there is error like below(i set use_client_gen=False): thank you very much:)

Traceback (most recent call last): File "train_pose.py", line 86, in vec_num=38, heat_num=19, batch_size=batch_size, shuffle=True) File "/home/hu/my_code/keras_openpose/training/ds_iterator.py", line 9, in init self.data_group = h5["data"] File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/home/ilan/minonda/conda-bld/work/h5py/_objects.c:2696) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/home/ilan/minonda/conda-bld/work/h5py/_objects.c:2654) File "/home/hu/anaconda3/lib/python3.5/site-packages/h5py/_hl/group.py", line 166, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/home/ilan/minonda/conda-bld/work/h5py/_objects.c:2696) File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/home/ilan/minonda/conda-bld/work/h5py/_objects.c:2654) File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/home/ilan/minonda/conda-bld/work/h5py/h5o.c:3582) KeyError: "Unable to open object (Object 'data' doesn't exist)"