text_expansion icon indicating copy to clipboard operation
text_expansion copied to clipboard

NotImplementedError: Cannot convert a symbolic Tensor (bert/encoder/strided_slice:0) to a numpy array.

Open bitov27 opened this issue 3 years ago • 0 comments

Hi! I have a problem in google colab (colab.research.google.com), during start Text_Expansion.ipynb (https://colab.research.google.com/github/dilyararimovna/text_expansion/blob/main/Text_Expansion.ipynb)

==================== Error =============================================== NotImplementedError Traceback (most recent call last)

in () 20 nlp.add_pipe(nlp.create_pipe('sentencizer'), first=True) 21 ---> 22 syntax_model = build_model(configs.syntax.syntax_ru_syntagrus_bert, download=True)

15 frames

<array_function internals> in prod(*args, **kwargs)

/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py in array(self) 734 def array(self): 735 raise NotImplementedError("Cannot convert a symbolic Tensor ({}) to a numpy" --> 736 " array.".format(self.name)) 737 738 def len(self):

NotImplementedError: Cannot convert a symbolic Tensor (bert/encoder/strided_slice:0) to a numpy array. =======================In this piece code============================================ import jsonlines import json import os import random import re import string
from copy import deepcopy from pathlib import Path

import numpy as np import pandas as pd import pymorphy2 import spacy import xx_ent_wiki_sm from deeppavlov import build_model, configs

morph = pymorphy2.MorphAnalyzer()

nlp = xx_ent_wiki_sm.load() nlp.add_pipe(nlp.create_pipe('sentencizer'), first=True)

syntax_model = build_model(configs.syntax.syntax_ru_syntagrus_bert, download=True)

Error on this line : syntax_model = build_model(configs.syntax.syntax_ru_syntagrus_bert, download=True)

Can anybody help me? Thanks.

bitov27 avatar Feb 23 '22 21:02 bitov27