Open GMXela opened 3 years ago
Hello guys, I'm new in Python coding and Deep Learning... I'm trying to run this code but I have this error : (I dont understand) THANKS for your help
Traceback (most recent call last): File "C:/Users/guit_/PycharmProjects/pythonProject/Main.py", line 7, in <module> pipeline = keras_ocr.pipeline.Pipeline() File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\pipeline.py", line 21, in __init__ recognizer = recognition.Recognizer() File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\recognition.py", line 324, in __init__ self.backbone, self.model, self.training_model, self.prediction_model = build_model( File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\recognition.py", line 254, in build_model x = keras.layers.Lambda(_transform, File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 925, in __call__ return self._functional_construction_call(inputs, args, kwargs, File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1117, in _functional_construction_call outputs = call_fn(cast_inputs, *args, **kwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\keras\layers\core.py", line 903, in call result = self.function(inputs, **kwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\recognition.py", line 90, in _transform indices_grid = _meshgrid(output_height, output_width) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\recognition.py", line 66, in _meshgrid x_coordinates, y_coordinates = tf.meshgrid(x_linspace, y_linspace) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper return target(*args, **kwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\ops\array_ops.py", line 3473, in meshgrid mult_fact = ones(shapes, output_dtype) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper return target(*args, **kwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\ops\array_ops.py", line 3041, in ones output = _constant_if_small(one, shape, dtype, name) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\ops\array_ops.py", line 2732, in _constant_if_small if np.prod(shape) < 1000: File "<__array_function__ internals>", line 5, in prod File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\numpy\core\fromnumeric.py", line 3030, in prod return _wrapreduction(a, np.multiply, 'prod', axis, dtype, out, File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\numpy\core\fromnumeric.py", line 87, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\framework\ops.py", line 845, in __array__ raise NotImplementedError( NotImplementedError: Cannot convert a symbolic Tensor (lambda_1/meshgrid/Size_1:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported
As described at "https://stackoverflow.com/questions/58479556/notimplementederror-cannot-convert-a-symbolic-tensor-2nd-target0-to-a-numpy"
Numpy downgrade helps if you cutrent version > 1.20 I've used 1.19.1 and it resolved issue with the same traceback in my case.
Hello guys, I'm new in Python coding and Deep Learning... I'm trying to run this code but I have this error : (I dont understand) THANKS for your help
Traceback (most recent call last): File "C:/Users/guit_/PycharmProjects/pythonProject/Main.py", line 7, in <module> pipeline = keras_ocr.pipeline.Pipeline() File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\pipeline.py", line 21, in __init__ recognizer = recognition.Recognizer() File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\recognition.py", line 324, in __init__ self.backbone, self.model, self.training_model, self.prediction_model = build_model( File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\recognition.py", line 254, in build_model x = keras.layers.Lambda(_transform, File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 925, in __call__ return self._functional_construction_call(inputs, args, kwargs, File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1117, in _functional_construction_call outputs = call_fn(cast_inputs, *args, **kwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\keras\layers\core.py", line 903, in call result = self.function(inputs, **kwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\recognition.py", line 90, in _transform indices_grid = _meshgrid(output_height, output_width) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\keras_ocr\recognition.py", line 66, in _meshgrid x_coordinates, y_coordinates = tf.meshgrid(x_linspace, y_linspace) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper return target(*args, **kwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\ops\array_ops.py", line 3473, in meshgrid mult_fact = ones(shapes, output_dtype) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper return target(*args, **kwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\ops\array_ops.py", line 3041, in ones output = _constant_if_small(one, shape, dtype, name) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\ops\array_ops.py", line 2732, in _constant_if_small if np.prod(shape) < 1000: File "<__array_function__ internals>", line 5, in prod File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\numpy\core\fromnumeric.py", line 3030, in prod return _wrapreduction(a, np.multiply, 'prod', axis, dtype, out, File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\numpy\core\fromnumeric.py", line 87, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) File "C:\Users\guit_\anaconda3\envs\Python_env\lib\site-packages\tensorflow\python\framework\ops.py", line 845, in __array__ raise NotImplementedError( NotImplementedError: Cannot convert a symbolic Tensor (lambda_1/meshgrid/Size_1:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported