# Error in PYNQ-DPU loading "xmodel"

**URL:** <https://discuss.pynq.io/t/error-in-pynq-dpu-loading-xmodel/2312>\
**Category:** Support\
**Created:** [February 9, 2021, 5:33pm UTC](https://discuss.pynq.io/t/error-in-pynq-dpu-loading-xmodel/2312 "2021-02-09T17:33:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucas\_Leiva](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/lucas_leiva/32/1773_2.png) [@Lucas\_Leiva](https://discuss.pynq.io/u/Lucas_Leiva)\
**Post date:** [February 9, 2021, 5:33pm UTC](https://discuss.pynq.io/t/error-in-pynq-dpu-loading-xmodel/2312/1 "2021-02-09T17:33:23Z")

</div>

Hi, I´m trying to upload the model compiled from train\_mnist\_classifier example. I am using PYNQ 2.6 , Vivado 2020.1 and PYNQ-DPU 1.2.  
When I compile the model, I get a “.xmodel” file instead of “.elf”. Then, I uploaded the model and the “dpu.bit” files to the board, but when I try to run this code in Jupyter Notebook:

from pynq\_dpu import DpuOverlay  
overlay = DpuOverlay(“…/mymodel/dpu.bit”)  
overlay.load\_model(“…/mymodel/mnist\_classifier.xmodel”)

appears this error:

RuntimeError Traceback (most recent call last)  
 in ()  
1 from pynq\_dpu import DpuOverlay  
2 overlay = DpuOverlay(“…/mymodel/dpu.bit”)  
----\> 3 overlay.load\_model(“…/mymodel/mnist\_classifier\_org.xmodel”)

/usr/local/lib/python3.6/dist-packages/pynq\_dpu/dpu.py in load\_model(self, model)  
211  
212 if not model.endswith(“.elf”):  
 → 213 raise RuntimeError(“Currently only elf files can be loaded.”)  
214 else:  
215 if self.runtime == ‘dnndk’:

RuntimeError: Currently only elf files can be loaded.

Any suggestions?  
Regards

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [February 18, 2021, 3:19pm UTC](https://discuss.pynq.io/t/error-in-pynq-dpu-loading-xmodel/2312/2 "2021-02-18T15:19:25Z")

</div>

xmodel is for Vitis AI 1.3. Check the README here:  
"  
For the GPU accelerated docker image:

./docker\_run.sh xilinx/vitis-ai:1.2.82  
From version 1.3 .xmodel files are generated instead of .elf  
"

> **[DPU-PYNQ/host at master · Xilinx/DPU-PYNQ](https://github.com/Xilinx/DPU-PYNQ/tree/master/host)**
>
> master/host

---

<div class="post-metadata">

**Author:** ![Gerardo\_V](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gerardo_v/32/1868_2.png) [@Gerardo\_V](https://discuss.pynq.io/u/Gerardo_V)\
**Post date:** [March 16, 2021, 3:22pm UTC](https://discuss.pynq.io/t/error-in-pynq-dpu-loading-xmodel/2312/3 "2021-03-16T15:22:01Z")

</div>

Is there any plan to support this soon? If not, is there a possible way of creating the .elf file based on vitis ai 1.3?

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [March 16, 2021, 9:58pm UTC](https://discuss.pynq.io/t/error-in-pynq-dpu-loading-xmodel/2312/4 "2021-03-16T21:58:31Z")

</div>

It is already supported in DPU-PYNQ v1.3.0

---

<div class="post-metadata">

**Author:** ![Gerardo\_V](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gerardo_v/32/1868_2.png) [@Gerardo\_V](https://discuss.pynq.io/u/Gerardo_V)\
**Post date:** [March 17, 2021, 12:33am UTC](https://discuss.pynq.io/t/error-in-pynq-dpu-loading-xmodel/2312/5 "2021-03-17T00:33:03Z")

</div>

So s you mean I can natively generate the .elf file even for vitis ai 1.3 while using DPU PYNQ repo? what about the .xmodel files, are they supported by PYQN ?  
As far as I know PYNQ 2.6 doesn’t support .xmodel file (I just update the dpu-pynq version of my ultra96v2) and I’m still not able to load them, because is not an elf file.

---

<div class="post-metadata">

**Author:** ![Gerardo\_V](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gerardo_v/32/1868_2.png) [@Gerardo\_V](https://discuss.pynq.io/u/Gerardo_V)\
**Post date:** [March 17, 2021, 2:53pm UTC](https://discuss.pynq.io/t/error-in-pynq-dpu-loading-xmodel/2312/6 "2021-03-17T14:53:01Z")

</div>

Sorry for the confusion, just for documenting, after upgrading my pynq version I had to update pynq-dpu to its latest version, after that I was able to load .xmodel files.
