tdozat / Parser-v2

An updated version of the Parser-v1 repo, used for Stanford's submission in the CoNLL17 shared task.
47 stars 34 forks source link

Parser breaks on latest numpy (1.14.0) #10

Closed nelson-liu closed 6 years ago

nelson-liu commented 6 years ago

Hi! When running your parser with the latest version of numpy, I get the following error:

Traceback (most recent call last):
  File "main.py", line 113, in <module>
    action(save_dir, **kwargs)
  File "main.py", line 63, in train
    network.train(load=load)
  File "<>/parser/network.py", line 104, in train
    trainset = Trainset.from_configurable(self, self.vocabs, nlp_model=self.nlp_model)
  File "<>/parser/configurable.py", line 111, in from_configurable
    return cls(*args, **kwargs)
  File "<>/parser/dataset.py", line 67, in __init__
    self._multibucket = Multibucket.from_dataset(self)
  File "<>/parser/multibucket.py", line 134, in from_dataset
    assert np.equal(indices[0].astype(int), indices[i].astype(int)).all()
ValueError: Can't cast from structure to non-structure, except if the structure only has a single field.

It seems like this error is a result of this recent numpy change: https://github.com/numpy/numpy/pull/6053 .

I fixed the issue by using the minimum version of numpy required for TF 1.0

nelson-liu commented 6 years ago

Opened a PR to address this at #11 . Figured it was worth making an issue so anyone else who runs into it can solve the problem with a search through the github issues. Closing this now.