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

tensorflow error: NodeDef mentions attr 'Truncate' not in Op<name=Cast;

serenayj opened this issue · comments

Hey,
I tried to load the model:
`import spacy
from benepar.spacy_plugin import BeneparComponent

nlp = spacy.load("en")
nlp.add_pipe(BeneparComponent("benepar_en2"))`

But I got error from tensorflow:
ValueError: NodeDef mentions attr 'Truncate' not in Op<name=Cast; signature=x:SrcT -> y:DstT; attr=SrcT:type; attr=DstT:type>; NodeDef: ToInt32_1 = Cast[DstT=DT_INT32, SrcT=DT_INT64, Truncate=false](strided_slice_7). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).

My tf version is 1.8.0, which was from one of the answer the author posted, but I still got this weird error. Anyone has idea about what's going wrong? Thanks a lot!

This may be too late response, but I think I have an answer for your question (I have just came across the same error message).

tf version 1.8.0 is seemed to work for "benepar_en" model.

In your code snippet "benepar_en2" model is used, so tf version 1.11.0 may works for you.

In setup.py, it is written as tf >= 1.11.0 is required.
https://github.com/nikitakit/self-attentive-parser/blob/master/setup.py#L47