baumgach/acdc_segmenter

KeyError: "Unable to open object (Object 'images_train' doesn't exist)"

hubutui opened this issue · 2 comments

Hello, I followed your README.md, but got this error. Output of python train.py:

2018-04-10 22:47:43,414 Could not import opencv. Augmentation functions will be unavailable.
2018-04-10 22:47:51,909 !! No GPU setup defined. Perhaps you need to set CUDA_VISIBLE_DEVICES etc...?
2018-04-10 22:47:51,910 Could not find cv2. If you want to use augmentation function you need to setup OpenCV.
2018-04-10 22:47:51,910 EXPERIMENT NAME: FCN8_bn_wxent
2018-04-10 22:47:51,910 !!!!!!!!!!!!!!!!!!!!!!!!!!!! Continuing previous run !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2018-04-10 22:47:51,910 !!! Didnt find init checkpoint. Maybe first run failed. Disabling continue mode...
2018-04-10 22:47:51,911 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2018-04-10 22:47:51,911 Already preprocessed this configuration. Loading now!
Traceback (most recent call last):
  File "train.py", line 529, in <module>
    main()
  File "train.py", line 519, in main
    run_training(continue_run)
  File "train.py", line 83, in run_training
    images_train = data['images_train']
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-tcce551v-build/h5py/_objects.c:2840)
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-tcce551v-build/h5py/_objects.c:2798)
  File "/usr/home/huyujin/Projects/acdc_segmenter/pyenv/venv/lib/python3.4/site-packages/h5py/_hl/group.py", line 169, 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 (/tmp/pip-tcce551v-build/h5py/_objects.c:2840)
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-tcce551v-build/h5py/_objects.c:2798)
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open (/tmp/pip-tcce551v-build/h5py/h5o.c:3734)
KeyError: "Unable to open object (Object 'images_train' doesn't exist)"

OS: Ubuntu 14.04.3 LTS
Python: 3.4.3

Any suggestion? Thank you.

Sorry, silly me. It seems that I should set data_root to the dir of training data.

Hi hubutui,
Glad you could resolve the issue. For future reference: this errors sometimes also occurs when the generation of the hdf5 data (i.e. writing the images into it) fails after the file has already been created. The code then thinks the data was preprocessed because the hdf5 file exists, but actually it is empty. If this occurs, fix the issue that caused the generation to fail in the first place and then manually delete the hdf5 file in the preproc_data folder and rerun the code.
Cheers, Christian