# Pytorch model compilation

**URL:** <https://discuss.tvm.apache.org/t/pytorch-model-compilation/10314>\
**Category:** Troubleshooting\
**Created:** [June 24, 2021, 2:20pm UTC](https://discuss.tvm.apache.org/t/pytorch-model-compilation/10314 "2021-06-24T14:20:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bolt](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@bolt](https://discuss.tvm.apache.org/u/bolt)\
**Post date:** [June 24, 2021, 2:20pm UTC](https://discuss.tvm.apache.org/t/pytorch-model-compilation/10314/1 "2021-06-24T14:20:30Z")

</div>

Hello,

I am facing an issue while loading a pytorch model with tvm. The following is the error scenario.

1. If I do torch.jit.load(“path”) without doing import tvm, the load is successful.
2. If I do it after import tvm in the script, there is an error of munmap\_chunk(), invalid pointer during torch.jit.load(“path”).

Is there any way to avoid this issue while using tvm?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![zhaoyang-star](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/zhaoyang-star/32/3904_2.png) [@zhaoyang-star](https://discuss.tvm.apache.org/u/zhaoyang-star)\
**Post date:** [October 20, 2022, 3:01am UTC](https://discuss.tvm.apache.org/t/pytorch-model-compilation/10314/2 "2022-10-20T03:01:29Z")

</div>

Same error. Do you have solved it?

---

<div class="post-metadata">

**Author:** ![masahi](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/masahi/32/74_2.png) [@masahi](https://discuss.tvm.apache.org/u/masahi)\
**Post date:** [October 20, 2022, 7:16am UTC](https://discuss.tvm.apache.org/t/pytorch-model-compilation/10314/3 "2022-10-20T07:16:10Z")

</div>

See [https://github.com/apache/tvm/issues/9362](https://github.com/apache/tvm/issues/9362). A simple workaround is to import torch before tvm.
