From 96be69cf0ebda11e18e0896f160546cdfcf5e42d Mon Sep 17 00:00:00 2001 From: ezirmusitua Date: Tue, 31 Oct 2023 15:09:42 +0800 Subject: [PATCH] Update install.md Signed-off-by: ezirmusitua --- .../current/start/install.md | 207 +++++++++--------- 1 file changed, 108 insertions(+), 99 deletions(-) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/start/install.md b/i18n/zh/docusaurus-plugin-content-docs/current/start/install.md index f51aed37..177068e6 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/start/install.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/start/install.md @@ -2,130 +2,130 @@ sidebar_position: 2 --- -# Install and uninstall WasmEdge +# 安装和卸载 WasmEdge -This chapter will discuss ways to install and uninstall the WasmEdge Runtime on various OSes and platforms. We will cover how to install plug-ins to WasmEdge. +本章将讨论在各种操作系统和平台上安装和卸载 WasmEdge 运行时的方法。同时也将介绍如何为 WasmEdge 安装插件。 :::note -Docker Desktop 4.15+ already has WasmEdge bundled in its distribution binary. If you use Docker Desktop, you will not need to install WasmEdge separately. Check out [how to run WasmEdge apps in Docker Desktop.](build-and-run/docker_wasm.md) +Docker Desktop 4.15+ 已经在其分发二进制文件中打包了 WasmEdge。如果你使用 Docker Desktop,则无需再单独安装 WasmEdge。详情请查看[如何在 Docker Desktop 中运行 WasmEdge 应用](https://chat.openai.com/c/build-and-run/docker_wasm.md)。 ::: -## Install +## 安装 -You can install the WasmEdge Runtime on any generic Linux and MacOS platforms. If you use Windows 10 or Fedora / Red Hat Linux systems, you can install with their default package managers. +你可以在任何通用的 Linux 和 MacOS 平台上安装 WasmEdge 运行时。如果你使用 Windows 10 或 Fedora/Red Hat Linux 系统,可以使用默认软件包管理器进行安装。 -### Generic Linux and MacOS +### 通用的 Linux 和 MacOS 平台 -The easiest way to install WasmEdge is to run the following command. Your system should have `git` and `curl` as prerequisites. +确保系统中已经安装了 `git` 和 `curl`,然后运行以下的命令安装 WasmEdge: ```bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash ``` -Run the following command to make the installed binary available in the current session. +运行以下命令让刚才安装的二进制文件可以在当前会话中使用。 ```bash source $HOME/.wasmedge/env ``` -#### Install for all users +#### 全局安装 -WasmEdge is installed in the `$HOME/.wasmedge` directory by default. You can install it into a system directory, such as `/usr/local` to make it available to all users. To specify an install directory, run the `install.sh` script with the `-p` flag. You will need to run the following commands as the `root` user or `sudo` since they are written write into system directories. +WasmEdge 默认被安装在 `$HOME/.wasmedge` 目录中。你也可以将其安装到系统目录,如 `/usr/local`,以使其对所有用户可用。若要指定安装目录,应使用 `install.sh -p` 进行安装,由于这些命令会执行会写入系统目录的操作,所以需要以 `root` 用户或使用 `sudo` 执行: ```bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -p /usr/local ``` -#### Install a specific version of WasmEdge +#### 安装特定版本的 WasmEdge -The WasmEdge installer script will install the latest official release by default. You could install a specific version of WasmEdge, including pre-releases or old releases by passing the `-v` argument to the installer script. Here is an example. +WasmEdge 安装程序脚本默认会安装最新的官方发布版本。 你可以通过使用 `-v` 参数来安装特定版本的 WasmEdge,包括预发布版本或旧版本。如下所示: ```bash VERSION={{ wasmedge_version }} curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $VERSION ``` -Suppose you are interested in the latest builds from the `HEAD` of the `master` branch, which is basically WasmEdge's nightly builds. In that case, you can download the release package directly from our Github Action's CI artifact. [Here is an example](https://github.com/WasmEdge/WasmEdge/actions/runs/2969775464#artifacts). +如果你对 `master` 分支的 `HEAD` 构建感兴趣(这基本上是 WasmEdge 的每夜构建版本)。在这种情况下,可以直接从我们的 Github Action 的 CI artifact 下载发布包。[以下是一个示例链接](https://github.com/WasmEdge/WasmEdge/actions/runs/2969775464#artifacts)。 -#### Install WasmEdge with plug-ins +#### 带插件安装 WasmEdge -WasmEdge plug-ins are pre-built native modules that provide additional functionalities to the WasmEdge Runtime. To install plug-ins with the runtime, you can pass the `--plugins` parameter in the installer. For example, the command below installs the `WASI-NN TensorFlow-Lite backend` plug-in, which allows WasmEdge apps to run inference on Tensorflow-Lite models with the `WASI-NN` proposal. +WasmEdge 插件是预构建的原生模块,为 WasmEdge 运行时提供额外功能。要在安装运行时的同时也安装插件,可以在安装程序中使用 `--plugins` 参数。例如,下面的命令安装 `WASI-NN TensorFlow-Lite backend` 插件,使 WasmEdge 应用能够在具有 `WASI-NN` 提案的 Tensorflow-Lite 模型上运行推理。 ```bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasi_nn-tensorflowlite ``` -To install multiple plug-ins, you can pass a list of plug-ins with the `--plugins` option. For example, the following command installs the `wasi-nn TensorFlow-Lite backend` and the `wasmedge_tensorflow` plug-ins. +若要安装多个插件,可以使用 `--plugins` 选项并传递插件列表。例如,以下命令安装了 `wasi-nn TensorFlow-Lite backend` 和 `wasmedge_tensorflow` 插件。 ```bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugins wasi_nn-tensorflowlite wasmedge_tensorflow ``` -The installer downloads the plug-in files from the WasmEdge release on GitHub, unzips them, and then copies them over to the `~/.wasmedge/plugin/` folder (for user install) and to the `/usr/local/lib/wasmedge/` folder (for system install). +安装程序会从 GitHub 上的 WasmEdge 发布中下载插件文件,解压然后复制到 `~/.wasmedge/plugin/` 文件夹(用户安装)或 `/usr/local/lib/wasmedge/` 文件夹(系统安装)。 :::note -AI plug-ins for WasmEdge, such as the `OpenVINO backend` or `PyTorch backend` for `WASI-NN` plug-ins, have additional dependencies on the `OpenVINO` or `PyTorch` runtime libraries. [See the next section](#install-wasmedge-plug-ins-and-dependencies) for commands to install the plug-in dependencies. +WasmEdge 的 AI 插件,如用于 `WASI-NN` 插件的 `OpenVINO backend` 或 `PyTorch backend`,还依赖于 `OpenVINO` 或 `PyTorch` 运行时库的其他依赖项。请参阅[下一节](#安装_WasmEdge_插件和依赖)获取安装插件依赖项的命令。 ::: ### Windows -For `Windows 10`, you could use Windows Package Manager Client (aka `winget.exe`) to install WasmEdge with one single command in your terminal. +对于 `Windows 10` 系统,你可以使用 Windows 软件包管理器客户端(即 `winget.exe`)在终端中使用下面的命令来安装 WasmEdge。 ```bash winget install wasmedge ``` -To install plug-ins, you can download plug-in binary modules from the WasmEdge release page, unzip them, and then copy them to `C:\Program Files\WasmEdge\lib`. +如果要安装插件,可以从 WasmEdge 发布页面下载插件二进制模块,解压然后复制到 `C:\Program Files\WasmEdge\lib` 目录下。 -### Fedora and Red Hat Linux +### Fedora 和 Red Hat Linux -WasmEdge is now an official package on Fedora 36, Fedora 37, Fedora 38, Fedora EPEL 8, and Fedora EPEL 9. Check out the stable version [here](https://src.fedoraproject.org/rpms/wasmedge). To install WasmEdge on Fedora, run the following command: +WasmEdge 现在是 Fedora 36、Fedora 37、Fedora 38、Fedora EPEL 8 和 Fedora EPEL 9 的官方软件包。要在 Fedora 上安装 WasmEdge,请运行以下命令: ```bash dnf install wasmedge ``` -For more usages, please check out Fedora docs. +更多用法,请查阅 Fedora 文档。 -To install plug-ins, you can download plug-in binary modules from the WasmEdge release page, unzip them, and then copy them over to `/usr/local/lib/wasmedge/`. +若要安装插件,可以从 WasmEdge 发布页面下载插件的二进制模块,解压然后复制到 `/usr/local/lib/wasmedge/` 目录下。 -## What's installed +## 安装内容 -If you install into the `$HOME/.wasmedge` directory, you will have the following directories and files after installation: +如果安装目录为 `$HOME/.wasmedge`,则在安装完成后会有以下目录和文件: -- The `$HOME/.wasmedge/bin` directory contains the WasmEdge Runtime CLI executable files. You can copy and move them around on your file system. +- `$HOME/.wasmedge/bin` 目录中包含 WasmEdge 运行时可执行文件。你可以在文件系统中复制和移动它们。 - - The `wasmedge` tool is the standard WasmEdge runtime. You can use it from the CLI. - - Execute a WASM file: `wasmedge --dir .:. app.wasm` - - The `wasmedgec` tool is the ahead-of-time (AOT) compiler to compile a `.wasm` file into a native `.so` file (or `.dylib` on MacOS, `.dll` on Windows, or `.wasm` as the universal WASM format on all platforms). The `wasmedge` can then execute the output file. + - `wasmedge` 工具是标准的 WasmEdge 运行时。你可以通过命令行界面 (CLI) 使用它。 + - 执行一个 WASM 文件:`wasmedge --dir .:. app.wasm` + - `wasmedgec` 工具是提前(AOT)编译器,用于将 `.wasm` 文件编译成本机的 `.so` 文件(在 MacOS 上则是 `.dylib`,在 Windows 上则是 `.dll`,或者在所有平台上通用的 `.wasm` 格式)。然后 `wasmedge` 可以执行输出的文件。 - - Compile a WASM file into a AOT-compiled WASM: `wasmedgec app.wasm app.so` - - Execute the WASM in AOT mode: `wasmedge --dir .:. app.so` + - 将 WASM 文件编译为 AOT 编译的 WASM:`wasmedgec app.wasm app.so` + - 以 AOT 模式执行 WASM:`wasmedge --dir .:. app.so` :::note - The usage of `wasmedgec` is equal to `wasmedge compile`. We decide to deprecate `wasmedgec` in the future. + `wasmedgec` 的用法等同于 `wasmedge compile`。我们决定在未来废弃 `wasmedgec`。 ::: -- The `$HOME/.wasmedge/lib` directory contains WasmEdge shared libraries and dependency libraries. They are useful for WasmEdge SDKs to launch WasmEdge programs and functions from host applications. -- The `$HOME/.wasmedge/include` directory contains the WasmEdge header files. They are useful for WasmEdge SDKs. -- The `$HOME/.wasmedge/plugin` directory contains the WasmEdge plug-ins. They are loadable extensions for WasmEdge SDKs and will automatically be loaded when running the WasmEdge CLI. +- `$HOME/.wasmedge/lib` 目录包含 WasmEdge 共享库和依赖库。这对于 WasmEdge SDK 在主机应用程序中启动 WasmEdge 程序和函数很有用。 +- `$HOME/.wasmedge/include` 目录包含 WasmEdge 头文件。这对于 WasmEdge SDK 很有用。 +- `$HOME/.wasmedge/plugin` 目录包含 WasmEdge 插件。这些是 WasmEdge SDK 的可加载扩展,在运行 WasmEdge CLI 时会自动加载。 :::note -You could also change it to `/usr/local` if you did a system-wide install. -If you used `winget` to install WasmEdge, the files are located at `C:\Program Files\WasmEdge`. +如果进行全局安装,则安装路径为 `/usr/local`。 +如果使用 `winget` 安装,则文件位于 `C:\Program Files\WasmEdge`。 ::: -## Install WasmEdge plug-ins and dependencies +## 安装 WasmEdge 插件和依赖项 -WasmEdge uses plug-ins to extend its functionality. If you want to use more of WasmEdge's features, you can install WasmEdge along with its plug-ins and extensions as described below: +WasmEdge 使用插件来扩展其功能。如果您想使用更多 WasmEdge 的功能,可以按下面的说明安装 WasmEdge 以及其插件和扩展: -### TLS plug-in +### TLS 插件 -The WasmEdge TLS plug-in utilizes the native OpenSSL library to support HTTPS and TLS requests from WasmEdge sockets. To install the WasmEdge TLS plug-in on Linux, run the following commands after you have installed WasmEdge. +WasmEdge TLS 插件利用本机 OpenSSL 库来支持 WasmEdge sockets 的 HTTPS 和 TLS 请求。如果要在 Linux 上安装 WasmEdge TLS 插件,则在安装 WasmEdge 后运行以下命令: ```bash wget https://github.com/WasmEdge/WasmEdge/releases/download/0.13.4/WasmEdge-plugin-wasmedge_rustls-0.13.4-manylinux2014_x86_64.tar.gz @@ -139,23 +139,23 @@ sudo mkdir -p /usr/local/lib/wasmedge/ sudo cp libwasmedge_rustls.so /usr/local/lib/wasmedge/ ``` -Then, go to [HTTPS request in Rust chapter](../develop/rust/http_service/client.md) to see how to run HTTPs services with Rust. +安装完成后,在 [Rust 中的 HTTPS 请求](../develop/rust/http_service/client.md) 章节中查看如何使用 Rust 运行 HTTPS 服务。 -### WASI-NN plug-in +### WASI-NN 插件 -WasmEdge supports various backends for `WASI-NN`. +WasmEdge 支持多种 `WASI-NN` 的后端。 -- [PyTorch backend](#wasi-nn-plug-in-with-pytorch-backend): supported on `Ubuntu above 20.04` and `manylinux2014_x86_64`. -- [OpenVINO™ backend](#wasi-nn-plug-in-with-openvino-backend): supported on `Ubuntu above 20.04`. -- [TensorFlow-Lite backend](#wasi-nn-plug-in-with-tensorflow-lite-backend): supported on `Ubuntu above 20.04`, `manylinux2014_x86_64`, and `manylinux2014_aarch64`. +- [PyTorch 后端](#wasi-nn-plug-in-with-pytorch-backend):支持 `Ubuntu 20.04 以上` 和 `manylinux2014_x86_64`。 +- [OpenVINO™ 后端](#wasi-nn-plug-in-with-openvino-backend):支持 `Ubuntu 20.04 以上`。 +- [TensorFlow-Lite 后端](#wasi-nn-plug-in-with-tensorflow-lite-backend):支持 `Ubuntu 20.04 以上`,`manylinux2014_x86_64` 和 `manylinux2014_aarch64`。 -Noticed that the backends are exclusive. Developers can only choose and install one backend for the `WASI-NN` plug-in. +注意这些后端是互斥的。开发者只能选择并安装一个后端用于 `WASI-NN` 插件。 -#### WASI-NN plug-in with PyTorch backend +#### 带有 PyTorch 后端的 WASI-NN 插件 -`WASI-NN` plug-in with `PyTorch` backend allows WasmEdge applications to perform `PyTorch` model inference. To install WasmEdge with `WASI-NN PyTorch backend` plug-in on Linux, please use the `--plugins wasi_nn-pytorch` parameter when [running the installer command](#generic-linux-and-macos). +`WASI-NN` 插件与 `PyTorch` 后端允许 WasmEdge 应用执行 `PyTorch` 模型推理。要在 Linux 上安装带有 `WASI-NN PyTorch 后端` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-pytorch` 参数。 -The `WASI-NN` plug-in with `PyTorch` backend depends on the `libtorch` C++ library to perform AI/ML computations. You need to install the [PyTorch 1.8.2 LTS](https://pytorch.org/get-started/locally/) dependencies for it to work properly. +`WASI-NN` 插件带有 `PyTorch` 后端依赖于 `libtorch` C++ 库来进行人工智能/机器学习计算。你需要安装[PyTorch 1.8.2 LTS](https://pytorch.org/get-started/locally/)的依赖项,以确保其正常工作。 ```bash export PYTORCH_VERSION="1.8.2" @@ -171,17 +171,17 @@ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/libtorch/lib :::note -For the `Ubuntu 20.04` or above versions, the WasmEdge installer will install the `Ubuntu` version of WasmEdge and its plug-ins. -For other systems, the WasmEdge installer will install the `manylinux2014` version, and you should get the `libtorch` without `cxx11-abi`. +对于 `Ubuntu 20.04` 或更高版本,WasmEdge 安装程序将安装 `Ubuntu` 版本的 WasmEdge 及其插件。 +对于其他系统,WasmEdge 安装程序将安装 `manylinux2014` 版本,并且你应该使用不带 `cxx11-abi` 的 `libtorch`。 ::: -Then, go to the [WASI-NN PyTorch backend in Rust chapter](../develop/rust/wasinn/pytorch) to see how to run AI inference with `Pytorch`. +安装完成后,请在 [Rust 中的 WASI-NN PyTorch 后端](../develop/rust/wasinn/pytorch) 章节中了解如何使用 `PyTorch` 运行人工智能推断。 -#### WASI-NN plug-in with OpenVINO backend +#### 带有 OpenVINO 后端的 WASI-NN 插件 -`WASI-NN` plug-in with `OpenVINO™` backend allows WasmEdge applications to perform `OpenVINO™` model inference. To install WasmEdge with `WASI-NN OpenVINO™ backend` plug-in on Linux, please use the `--plugins wasi_nn-openvino` parameter when [running the installer command](#generic-linux-and-macos). +`WASI-NN` 插件与 `OpenVINO™` 后端允许 WasmEdge 应用执行 `OpenVINO™` 模型推断。要在 Linux 上安装带有 `WASI-NN OpenVINO™ 后端` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-openvino` 参数。 -The `WASI-NN` plug-in with `OpenVINO™` backend depends on the `OpenVINO™` C library to perform AI/ML computations. [OpenVINO™](https://docs.openvino.ai/2023.0/openvino_docs_install_guides_installing_openvino_apt.html)(2023) dependencies. The following instructions are for Ubuntu 20.04 and above. +`WASI-NN` 插件带有 `OpenVINO™` 后端依赖于 `OpenVINO™` C 库来进行人工智能/机器学习计算。[OpenVINO™](https://docs.openvino.ai/2023.0/openvino_docs_install_guides_installing_openvino_apt.html)(2023)依赖项。以下说明适用于 Ubuntu 20.04 及以上版本。 ```bash wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB @@ -192,91 +192,92 @@ sudo apt-get -y install openvino ldconfig ``` -Then, go to the [WASI-NN OpenVINO™ backend in Rust](../develop/rust/wasinn/openvino) chapter to see how to run AI inference with `OpenVINO™`. +安装完成后,请在 [Rust 中的 WASI-NN OpenVINO™ 后端](../develop/rust/wasinn/openvino) 章节查看如何使用 `OpenVINO™` 运行人工智能推断。 -#### WASI-NN plug-in with TensorFlow-Lite backend +#### 带有 TensorFlow-Lite 后端的 WASI-NN 插件 -`WASI-NN` plug-in with `Tensorflow-Lite` backend allows WasmEdge applications to perform `Tensorflow-Lite` model inference. To install WasmEdge with `WASI-NN Tensorflow-Lite backend` plug-in on Linux, please use the `--plugins wasi_nn-tensorflowlite` parameter when [running the installer command](#generic-linux-and-macos). +`WASI-NN` 插件与 `Tensorflow-Lite` 后端允许 WasmEdge 应用执行 `Tensorflow-Lite` 模型推断。要在 Linux 上安装带有 `WASI-NN Tensorflow-Lite 后端` 的 WasmEdge,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_nn-tensorflowlite` 参数。 -The `WASI-NN` plug-in with `Tensorflow-Lite` backend depends on the `libtensorflowlite_c` shared library to perform AI/ML computations, and it will be installed by the installer automatically. +`WASI-NN` 插件带有 `Tensorflow-Lite` 后端依赖于 `libtensorflowlite_c` 共享库来进行人工智能/机器学习计算,并将由安装程序自动安装。 :::note -If you install this plug-in WITHOUT installer, you can [refer to here to install the dependency](#tensorflow-lite-dependencies). +如果安装了该插件,但并非使用上面的方式,可以参考[此处](#tensorflow-lite-dependencies)安装依赖项。 :::note -Then, go to [WASI-NN TensorFlow-lite backend in Rust chapter](../develop/rust/wasinn/tensorflow_lite) to see how to run AI inference with `TensorFlow-Lite`. +安装完成后,查看 [Rust 中的 WASI-NN TensorFlow-Lite 后端](../develop/rust/wasinn/tensorflow_lite) 章节了解如何使用 `TensorFlow-Lite` 运行人工智能推断。 -### WASI-Crypto Plug-in +### WASI-Crypto 插件 -[WASI-crypto](https://github.com/WebAssembly/wasi-crypto) is Cryptography API proposals for WASI. To use WASI-Crypto proposal, please use the `--plugins wasi_crypto` parameter when [running the installer command](#generic-linux-and-macos). +[WASI-crypto](https://github.com/WebAssembly/wasi-crypto) 是 WASI 的密码学 API 提案。若要使用 WASI-Crypto 提案,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasi_crypto` 参数。 -Then, go to [WASI-Crypto in Rust chapter](../develop/rust/wasicrypto.md) to see how to run `WASI-crypto` functions. +安装完成后,查看 [Rust 中的 WASI-Crypto](../develop/rust/wasicrypto.md) 章节了解如何运行 `WASI-crypto` 函数。 -### WasmEdge Image Plug-in +### WasmEdge 图像插件 -The wasmEdge-Image plug-in can help developers to load and decode JPEG and PNG images and convert into tensors. To install this plug-in, please use the `--plugins wasmedge_image` parameter when [running the installer command](#generic-linux-and-macos). +wasmEdge-Image 插件可以帮助开发人员加载和解码 JPEG 和 PNG 图像,并将其转换为张量。要安装此插件,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasmedge_image` 参数。 -Then, go to [TensorFlow interface (image part) in Rust chapter](../develop/rust/wasinn/tf_plugin.md#image-loading-and-conversion) to see how to run `WasmEdge-Image` functions. +安装完成后,查看 [Rust 中的 TensorFlow 接口(图像部分)](../develop/rust/wasinn/tf_plugin.md#image-loading-and-conversion) 章节了解如何运行 `WasmEdge-Image` 函数。 -### WasmEdge TensorFlow Plug-in +### WasmEdge TensorFlow 插件 -WasmEdge-TensorFlow plug-in can help developers to perform `TensorFlow` model inference as the similar API in python. To install this plug-in, please use the `--plugins wasmedge_tensorflow` parameter when [running the installer command](#generic-linux-and-macos). +WasmEdge-TensorFlow 插件可以帮助开发人员执行与 Python 中相似的 `TensorFlow` 模型推断。要安装此插件,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasmedge_tensorflow` 参数。 -The WasmEdge-Tensorflow plug-in depends on the `libtensorflow_cc` shared library. +WasmEdge-TensorFlow 插件依赖于 `libtensorflow_cc` 共享库。 :::note -If you install this plug-in WITHOUT installer, you can [refer to here to install the dependency](#tensorflow-dependencies). +如果安装了该插件,但并非使用上面的方式,可以参考[此处](#tensorflow-dependencies)安装依赖项。 :::note -Then, go to [TensorFlow interface in Rust chapter](../develop/rust/wasinn/tf_plugin.md) to see how to run `WasmEdge-TensorFlow` functions. +安装完成后,查看 [Rust 中的 TensorFlow 接口](../develop/rust/wasinn/tf_plugin.md) 章节了解如何运行 `WasmEdge-TensorFlow` 函数。 -### WasmEdge TensorFlow-Lite Plug-in +### WasmEdge TensorFlow-Lite 插件 -The wasmEdge-TensorFlowLite plug-in can help developers to perform `TensorFlow-Lite` model inference as the similar API in python. To install this plug-in, please use the `--plugins wasmedge_tensorflowlite` parameter when [running the installer command](#generic-linux-and-macos). +wasmEdge-TensorFlowLite 插件可以帮助开发人员执行与 Python 中类似的 `TensorFlow-Lite` 模型推断。要安装此插件,请在[运行安装命令](#generic-linux-and-macos)时使用 `--plugins wasmedge_tensorflowlite` 参数。 -The WasmEdge-TensorflowLite plug-in depends on the `libtensorflowlite_c` shared library to perform AI/ML computations, and it will be installed by the installer automatically. +WasmEdge-TensorflowLite 插件依赖于 `libtensorflowlite_c` 共享库来执行人工智能/机器学习计算(由安装程序自动安装)。 :::note -If you install this plug-in WITHOUT installer, you can [refer to here to install the dependency](#tensorflow-lite-dependencies). +如果安装了该插件,但并非使用上面的方式,可以参考[此处](#tensorflow-lite-dependencies)安装依赖项。 :::note Then, go to [TensorFlow interface in Rust chapter](../develop/rust/wasinn/tf_plugin.md) to see how to run `WasmEdge-TensorFlowLite` functions. +安装完成后,查看 [Rust 中的 TensorFlow 接口](../develop/rust/wasinn/tf_plugin.md) 章节了解如何运行 `WasmEdge-TensorFlowLite` 函数。 -## Install WasmEdge extensions and dependencies +## 安装 WasmEdge 扩展和依赖项 :::note -The WasmEdge extensions are deprecated and replaced by the plug-ins since `0.13.0`. The latest version supporting the extensions is `0.12.1`. This chapter will be removed when the `0.12.x` versions are no longer supported by the WasmEdge installer. +WasmEdge 扩展自 `0.13.0` 版本起已被弃用,并由插件取代。支持扩展的最新版本是 `0.12.1`。当 WasmEdge 安装程序不再支持 `0.12.x` 版本时,本章节将被移除。 :::note -To install the WasmEdge extensions, please use the `-e` option and assign the WasmEdge version before `0.13.0`. You can also use the `-e all` to install the supported extensions. +要安装 WasmEdge 扩展,请在使用 `-e` 选项指定查看,并安装 `0.13.0` 之前的版本。你也可以使用 `-e all` 安装所有支持的扩展。 -### WasmEdge Image extension +### WasmEdge 图像扩展 -WasmEdge Image extension (replaced by the [WasmEdge-Image plug-in](#wasmedge-image-plug-in) after `0.13.0`) can help developers to load and decode JPEG and PNG images and convert them into tensors. To install this extension, please use the `-e image` parameter when [running the installer command](#generic-linux-and-macos). +WasmEdge 图像扩展(在 `0.13.0 `后被 [WasmEdge-Image 插件](#wasmedge-image-plug-in) 取代)可以帮助开发者加载和解码 JPEG 和 PNG 图像,并将其转换为张量。要安装此扩展,请在[运行安装命令](#generic-linux-and-macos)时使用 `-e image` 参数。 -### WasmEdge Tensorflow and TensorFlow-Lite extension with CLI tool +### WasmEdge Tensorflow 和 TensorFlow-Lite 带有 CLI 工具的扩展 -WasmEdge Tensorflow extension and the CLI tool (replaced by the [WasmEdge-Tensorflow plug-in](#wasmedge-tensorflow-plug-in) and the [WasmEdge-TensorflowLite plug-in](#wasmedge-tensorflow-lite-plug-in) after `0.13.0`) can help developers to perform `TensorFlow` and `TensorFlow-Lite` model inference as the similar API in python. To install this extension, please use the `-e tensorflow` parameter when [running the installer command](#generic-linux-and-macos). +WasmEdge Tensorflow 扩展和 CLI 工具(在 `0.13.0` 后被 [WasmEdge-Tensorflow 插件](#wasmedge-tensorflow-plug-in) 和 [WasmEdge-TensorflowLite 插件](#wasmedge-tensorflow-lite-plug-in) 取代)可以帮助开发者执行类似于 Python 中的 `TensorFlow` 和 `TensorFlow-Lite` 模型推断。要安装此扩展,请在[运行安装命令](#generic-linux-and-macos)时使用 `-e tensorflow` 参数。 -## Uninstall +## 卸载 -To uninstall WasmEdge, you can run the following command: +使用下面的指令卸载 WasmEdge: ```bash bash <(curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/uninstall.sh) ``` -If the `wasmedge` binary is not in `PATH` and it wasn't installed in the default `$HOME/.wasmedge` folder, then you must provide the installation path. +如果 `wasmedge` 可执行文件不在系统路径 `PATH` 中,并且没有被安装在默认的 `$HOME/.wasmedge` 文件夹中,则必须提供安装路径才能卸载。 ```bash bash <(curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/uninstall.sh) -p /path/to/parent/folder ``` -If you wish to uninstall uninteractively, you can pass in the `--quick` or `-q` flag. +如果你希望以非交互的方式执行卸载,可以使用 `--quick` 或 `-q` 参数。 ```bash bash <(curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/uninstall.sh) -q @@ -284,26 +285,26 @@ bash <(curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/util :::note -If a parent folder of the `wasmedge` binary contains `.wasmedge`, the folder will be considered for removal. For example, the script altogether removes the default `$HOME/.wasmedge` folder. +如果 `wasmedge` 可执行文件的父文件夹包含 `.wasmedge`,则该文件夹也会被删除。例如,脚本会一并删除默认的 `$HOME/.wasmedge` 文件夹。 ::: -If you used `dnf` to install WasmEdge on Fedora and Red Hat Linux, run the following command to uninstall it: +如果你在 Fedora 和 Red Hat Linux 上使用 `dnf` 安装了 WasmEdge,运行以下命令来卸载它: ```bash dnf remove wasmedge ``` -If you used `winget` to install WasmEdge on Windows, run the following command to uninstall it: +如果你在 Windows 上使用 `winget` 安装 WasmEdge,运行以下命令来卸载它: ```bash winget uninstall wasmedge ``` -## Appendix: Installing the TensorFlow Dependencies +## 附录:安装 TensorFlow 依赖项 -### TensorFlow Dependencies +### TensorFlow 依赖 -If you install the `WasmEdge-Tensorflow` plug-in WITHOUT installer, you can download the shared libraries with the following commands: +如果未使用安装程序安装 `WasmEdge-Tensorflow` 插件,你可以使用以下命令下载共享库: ```bash VERSION=TF-2.12.0-CC @@ -317,7 +318,7 @@ tar -zxf WasmEdge-tensorflow-deps-TF-TF-$VERSION-$PLATFORM.tar.gz rm -f WasmEdge-tensorflow-deps-TF-TF-$VERSION-$PLATFORM.tar.gz ``` -The shared library will be extracted in the current directory `./libtensorflow_cc.so.2.12.0` and `./libtensorflow_framework.so.2.12.0` on `Linux` platforms, or `./libtensorflow_cc.2.12.0.dylib` and `./libtensorflow_framework.2.12.0.dylib` on `MacOS` platforms. You can move the library to the installation path: +在 `Linux` 平台上,共享库将被提取到当前目录 `./libtensorflow_cc.so.2.12.0` 和 `./libtensorflow_framework.so.2.12.0`,而在 `MacOS` 平台上,共享库将提取到 `./libtensorflow_cc.2.12.0.dylib` 和 `./libtensorflow_framework.2.12.0.dylib`。你可以手动将库移动到安装路径: ```bash # If you installed wasmedge locally as above @@ -345,9 +346,9 @@ ln -s libtensorflow_framework.2.12.0.dylib ~/.wasmedge/lib/libtensorflow_framewo ln -s libtensorflow_framework.2.dylib ~/.wasmedge/lib/libtensorflow_framework.dylib ``` -### TensorFlow-Lite Dependencies +### TensorFlow-Lite 依赖 -If you install the `WasmEdge-TensorflowLite` plug-in WITHOUT installer, you can download the shared libraries with the following commands: +如果未使用安装程序安装 `WasmEdge-TensorflowLite` 插件,您可以使用以下命令下载共享库: ```bash VERSION=TF-2.12.0-CC @@ -363,6 +364,8 @@ rm -f WasmEdge-tensorflow-deps-TFLite-$VERSION-$PLATFORM.tar.gz The shared library will be extracted in the current directory `./libtensorflowlite_c.so` (or `.dylib` for MacOS) and `./libtensorflowlite_flex.so` (after the `WasmEdge 0.13.0` version). You can move the library to the installation path: +共享库将被提取到当前目录 `./libtensorflowlite_c.so`(在 MacOS 则是 `.dylib`),以及 `./libtensorflowlite_flex.so`(自 `WasmEdge 0.13.0` 版本之后)。你可以手动将这些库移动到安装路径: + ```bash # If you installed wasmedge locally as above mv libtensorflowlite_c.so ~/.wasmedge/lib @@ -383,6 +386,12 @@ Some users, especially in China, reported encountering the Connection refused er Please make sure your network connection can access `github.com` and `githubusercontent.com` via VPN. +## 故障排除 + +一些用户,特别是在中国用户,在从 `githubusercontent.com` 上下载 `install.sh` 时遇到了“连接被拒绝”的错误。 + +请确保你的网络可以访问 `github.com` 和 `githubusercontent.com`(可以使用代理或 VPN、或 github 代理)。 + ```bash # The error message curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash