e2e-coref icon indicating copy to clipboard operation
e2e-coref copied to clipboard

"genre Unable to open" Error

Open Rooders opened this issue 5 years ago • 4 comments

why report KeyError: "Unable to open object (object 'pt' doesn't exist)" when I use predict.py

Rooders avatar May 14 '19 12:05 Rooders

I have the same issue. the error is this:

Traceback (most recent call last):
  File "predict.py", line 30, in <module>
    tensorized_example = model.tensorize_example(example, is_training=False)
  File "/content/e2e-coref/coref_model.py", line 161, in tensorize_example
    lm_emb = self.load_lm_embeddings(doc_key)
  File "/content/e2e-coref/coref_model.py", line 100, in load_lm_embeddings
    group = self.lm_file[file_key]
  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 "/usr/local/lib/python2.7/dist-packages/h5py/_hl/group.py", line 177, 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
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'nw' doesn't exist)"

AradAshrafi avatar Jul 03 '19 08:07 AradAshrafi

why report KeyError: "Unable to open object (object 'pt' doesn't exist)" when I use predict.py

Because the hdf5 stores the embeeding which already preprocessed before, if the word is not in the hdf5, it will get this problem "object 'XXX' doesn't exist".it just like the key in the dict. so, you should preprocess the data which you will use in the prediction.

henryhust avatar Dec 06 '19 05:12 henryhust

@AradAshrafi I'm having the same issue. Did you manage to fix it?

CaoHoangTung avatar Jun 08 '20 08:06 CaoHoangTung

Have you solved this problem? I have a similar problem

liyaoshigehaoren avatar Jun 13 '20 07:06 liyaoshigehaoren