Google Document类型对象引发调试器崩溃及FastAPI连接异常问题
问题描述:Google Document AI Document对象引发调试崩溃与FastAPI连接异常
- 系统环境:Windows 11 Pro 23H2
- VS Code版本:1.93.1
- 使用工具:Google Document AI API
核心问题:
从Google Document AI API获取的Document类型对象一旦出现在变量中,VS Code的调试服务器就会直接崩溃,且调试控制台、终端均无任何日志输出。
复现代码及异常表现:
尝试通过以下代码记录Document对象时,出现类似异常:
import logging from google.cloud.documentai import Document with open( "./test_data/documents/redefine_meat/beef_patties/Premium_burger_ocr_document.pickle", "rb", ) as f: doc: Document = pickle.load(f) logging.info(f"The document: {doc}")
运行该代码的FastAPI服务器会突然拒绝所有活跃连接,但进程并未实际崩溃,控制台也没有日志输出。不过直接在FastAPI中打印Document对象却无任何问题。
问题演示:
内容的提问来源于stack exchange,提问作者user5134394
相关产品推荐
相关产品推荐

