sgrvinod / a-PyTorch-Tutorial-to-Image-Captioning

Show, Attend, and Tell | a PyTorch Tutorial to Image Captioning
MIT License
2.76k stars 713 forks source link

Some problem in creat_input_files.py #7

Closed RobinWenqian closed 6 years ago

RobinWenqian commented 6 years ago

Thank you for your effort to complete the code. When I ran the code 'create_input_files.py' I met some problems which shows in the picture: image I have not met the problem like this.Could you give me some advice on how to fix it in your convenient time?

sgrvinod commented 6 years ago

Hi, this happens when the HDF5 file already exists. If you want to create it again, you need to delete the old file. Let me know if this fixes it.

RobinWenqian commented 6 years ago

Thank you for your quick reply. I will have a try. And where I can find the HDF5 file if I want to delete it?

sgrvinod commented 6 years ago

You will find it/them in the output folder location you specified here.

RobinWenqian commented 6 years ago

Thank you so much for your patient reply. I will have a try and give you a feedback.

RobinWenqian commented 6 years ago

I have fixed it and know why I initially can not create input files. I don not know when the two caption files show in the target route. They may be downloaded from the link in the Readme.md

Thank you so much and if there are other questions I will get to you.

zxh19976666 commented 2 years ago

sorry sir when i run creat_input_files.py it show me this:

Reading TRAIN images and captions, storing to file...

24%|███████████████████████████████▊ | 27324/113287 [04:11<13:12, 108.54it/s] Traceback (most recent call last): File "create_input_files.py", line 11, in max_len=50) File "/home/qq/zxh/a-PyTorch-Tutorial-to-Image-Captioning-master/utils.py", line 125, in create_input_files images[i] = img 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 "/home/qq/miniconda3/envs/zxhatt/lib/python3.6/site-packages/h5py/_hl/dataset.py", line 708, in setitem self.id.write(mspace, fspace, val, mtype, dxpl=self._dxpl) 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/h5d.pyx", line 222, in h5py.h5d.DatasetID.write File "h5py/_proxy.pyx", line 132, in h5py._proxy.dset_rw File "h5py/_proxy.pyx", line 93, in h5py._proxy.H5PY_H5Dwrite OSError: Can't write data (file write failed: time = Tue Nov 9 16:34:16 2021 , filename = '/home/qq/zxh/a-PyTorch-Tutorial-to-Image-Captioning-master/dataout/TRAIN_IMAGES_coco_5_cap_per_img_5_min_word_freq.hdf5', file descriptor = 3, errno = 28, error message = 'No space left on device', buf = 0x556e4e3afb50, total write size = 2048, bytes this sub-write = 2048, bytes actually written = 18446744073709551615, offset = 0)

how to solve this problem? why? and i saw my output_folder,it already have TRAIN_IMAGES_coco_5_cap_per_img_5_min_word_freq.hdf5 and WORDMAP_coco_5_cap_per_img_5_min_word_freq.json

thank you sir!