You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on Jupyter Notebook and the kernel keeps dying.
My code is shown below, Cell 1-4 runs fine when i start running cell 5 it will print out the first debug statement then the kernel will die. If i run Cell 5 first then kernel dies when i try running "from paddleocr import PaddleOCR, draw_ocr" (Cell 2). It's like i can not use both paddleocr and gradio together? Can someone help out pls! I am trying to use gradio for Interface.
Code Cell 2 from paddleocr import PaddleOCR, draw_ocr ocr = PaddleOCR(use_angle_cls=True, lang='en') # need to run only once to download and load model into memory
Code Cell 4 for idx in range(len(result)): res = result[idx] for line in res: if isinstance(line, tuple) and len(line) == 2: # Check if it's a tuple with two elements (text, confidence) text, confidence = line print(text)
Code Cell 5
`print("Cell start")
import gradio as gr
print("Import Done")
with gr.Blocks() as demo:
gr.Image()
demo.launch()`
I have tried restarting the kernel, re-installing the whole system yet the same problem. When i run them on separate files (PaddleOCR and Gradio) then they work.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on Jupyter Notebook and the kernel keeps dying.
My code is shown below, Cell 1-4 runs fine when i start running cell 5 it will print out the first debug statement then the kernel will die. If i run Cell 5 first then kernel dies when i try running "from paddleocr import PaddleOCR, draw_ocr" (Cell 2). It's like i can not use both paddleocr and gradio together? Can someone help out pls! I am trying to use gradio for Interface.
Code Cell 1
%%capture !pip install paddleocr !pip install gradio
Code Cell 2
from paddleocr import PaddleOCR, draw_ocr ocr = PaddleOCR(use_angle_cls=True, lang='en') # need to run only once to download and load model into memory
Code Cell 3
%%capture img_path = '/Users/xxx/Desktop/xxx.jpg' result = ocr.ocr(img_path, cls=True)
Code Cell 4
for idx in range(len(result)): res = result[idx] for line in res: if isinstance(line, tuple) and len(line) == 2: # Check if it's a tuple with two elements (text, confidence) text, confidence = line print(text)
Code Cell 5
`print("Cell start")
import gradio as gr
print("Import Done")
with gr.Blocks() as demo:
gr.Image()
demo.launch()`
I have tried restarting the kernel, re-installing the whole system yet the same problem. When i run them on separate files (PaddleOCR and Gradio) then they work.
Beta Was this translation helpful? Give feedback.
All reactions