Error

【免费下载链接】ge GE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。 【免费下载链接】ge 项目地址: https://gitcode.com/cann/ge

Module Import

from ge.error import GeError

Functionality Description

GeError is the exception type thrown when GE Python API fails to call underlying GE interfaces, inheriting from RuntimeError. Existing code catching RuntimeError can still catch this exception; when needing to read GE ErrMgr internal error information and interface context, can catch GeError.

Class Definition

class GeError(RuntimeError):
    error_message: Optional[str]
    api_name: Optional[str]
    context: Dict[str, Any]

Attribute Description

| Attribute | Type | Description | | | :--- | :--- | :--- | | error_message | Optional[str] | Internal error information reported by GE ErrMgr | | api_name | Optional[str] | Name of failed Python API or underlying GE API | | context | Dict[str, Any] | Context information supplemented by Python interface, such as graph_id, stream, output_file |

Usage Example

from ge.error import GeError
from ge.session import Session

try:
    session = Session()
    outputs = session.run_graph(0, [])
except GeError as err:
    print(err.error_message)

【免费下载链接】ge GE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。 【免费下载链接】ge 项目地址: https://gitcode.com/cann/ge

更多推荐