# MindSpore报错报错BrokenPipeError: \[Errno 32\] Broken pipe

**1. 系统环境**

硬件环境\(Ascend/GPU/CPU\): Ascend

软件环境: MindSpore 版本: 2.2.10

执行模式： Graph

**2. 报错信息**

```
Process ForkServerPoolWorker-6:
Traceback (most recent call last):
    File "/root/miniconda3/envs/ms21_py38/lib/python3.8/multiprocessing/pool.py", line 13l, in worker
        put((job, i, result))
    File "/root/miniconda3/envs/ms21_py38/lib/python3.8/multiprocessing/queues.py", line368, in put
        self._writer.send_bytes(obj)
    File "/root/miniconda3/envs/ms21_py38/lib/python3.8/multiprocessing/connection.py", line 200, in send bytes
        self. send bytes(mloffset:of fset + size])
    File "/root/miniconda3/envs/ms21_py38/lib/python3.8/multiprocessing/connection.py", line 41l, in _send bytes
        self. send(header + buf)
    File "/root/miniconda3/envs/ms21_py38/lib/python3.8/multiprocessing/connection.py", line 368, in _send
        n = write(self. handle, buf)
BrokenPipeError: [Errno32] Broken pipe
```

**3. 根因分析**

报错信息为读写失败，定位方向为：查看代码中，是否有往磁盘读写文件的操作原因：

```
context.set_context(mode=context.GRAPH_MODE, device_target=opt.device_target, enable_compile_cache=True, compile_cache_path="./cache", max_call_depth=4096)
```

代码中开启了编译缓存，但写入的路径，本地没有。

**4. 解决方案**

修改context为

```
context.set_context(mode=context.GRAPH_MODE, device_target=opt.device_target, max_call_depth=4096)
```

删除enable\_compile\_cache=True, compile\_cache\_path="./cache"。

