---
title: 获取PyTorch源码失败的解决办法
description: "获取PyTorch源码时提示unexpected disconnect while reading sideband packet。详细信息如下："
url: https://www.hikunpeng.com/document/detail/zh/SRA/ecosystemEnable/PyTorch/kunpengpytorch_02_0019.html
sourcePath: /source/zh/SRA/ecosystemEnable/PyTorch/kunpengpytorch_02_0019.html
indexId: 917b3b7cb0359885faad73f3dd71f4dfae9dbefe44d0f8257b5b74158485d2fb66
---
# 获取PyTorch源码失败的解决办法

#### 问题现象描述

获取PyTorch源码时提示unexpected disconnect while reading sideband packet。详细信息如下：

```
Cloning into 'pytorch'...
remote: Enumerating objects: 13382, done.
remote: Counting objects: 100% (13382/13382), done.
remote: Compressing objects: 100% (11353/11353), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 1504 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
```


#### 关键过程、根本原因分析

网络质量不佳导致代码下载失败。


#### 结论、解决方案及效果

重新执行获取源码命令。

```
git clone -b v2.1.2 https://github.com/pytorch/pytorch.git --depth 1
```
