Follow along with the book to learn computer vision tasks like image classification, object detection, and image generation using PyTorch.
Deploy a trained PyTorch model to production using ONNX or TensorRT for faster inference on real hardware.
Run Chinese open-source LLMs like Qwen or ChatGLM locally using the provided deployment guides and code.
Build an NLP pipeline for text classification, translation, or question answering using Transformer architectures.
Requires a GPU and a working CUDA-enabled PyTorch installation, most notebooks assume NVIDIA hardware.
This repository is the companion code for a Chinese-language book called "PyTorch Practical Tutorial, Second Edition." The book teaches how to use PyTorch, an open-source library for building and training machine learning models, starting from zero knowledge and advancing to real-world deployment. The README and content are written in Chinese, though the underlying code uses standard Python. The book is organized into three sections. The first covers PyTorch fundamentals: setting up a development environment, working with data, building models, and visualizing results. The second section covers applied projects across three main areas. In computer vision, topics include image classification, object detection, image segmentation, object tracking, image generation using both older GAN methods and newer diffusion-based methods, image description, and image search. In natural language processing, the book covers standard architectures like RNNs, Transformers, and BERT, applied to tasks like text classification, translation, and question answering. It also covers large language model deployment, walking through four Chinese open-source models: Qwen, ChatGLM, Baichuan, and Yi. The third section focuses on getting trained models into production, covering two frameworks called ONNX and TensorRT that convert PyTorch models into faster formats for deployment, plus model quantization techniques that reduce size and speed up inference. All the code is available free and open online, readable either through the GitHub repository or a companion documentation website. The license is CC BY-NC 4.0, which means you can use and share the material for personal or educational purposes but not for commercial products. The author spent roughly five years on both editions combined and notes that more chapters will be added over time as the AI field evolves.
← tingsongyu on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.