nikitakit / self-attentive-parser

High-accuracy NLP parser with models for 11 languages.

Home Page:https://parser.kitaev.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'tensorflow' has no attribute 'GraphDef'

ssbpv opened this issue · comments

commented

Hello,
I have tensor flow 1.14 and I get the following error on this command:nlp.add_pipe(BeneparComponent('benepar_en')). Please let us know how to resolve this?

197 graph_def = tf.GraphDef.FromString(model['model'])
198 else:
--> 199 graph_def = tf.GraphDef.FromString(model)
200 tf.import_graph_def(graph_def, name='')
201

AttributeError: module 'tensorflow' has no attribute 'GraphDef'

You can replace tf.GraphDef by tf.compat.v1.GraphDef.

You'll also need to change line 202 to self._sess = tf.compat.v1.Session(graph=self._graph)

This should be included in the next build. As its a major issue, that breaks the examples in the readme file.