# UndefVarError: DataLoader not defined

**URL:** https://discourse.julialang.org/t/undefvarerror-dataloader-not-defined/82759
**Category:** Tooling
**Created:** [June 14, 2022, 3:30pm UTC](https://discourse.julialang.org/t/undefvarerror-dataloader-not-defined/82759 "2022-06-14T15:30:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![soczek322](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soczek322/32/37166_2.png) [@soczek322](https://discourse.julialang.org/u/soczek322)
#### Post date: [June 14, 2022, 3:30pm UTC](https://discourse.julialang.org/t/undefvarerror-dataloader-not-defined/82759/1 "2022-06-14T15:30:35Z")

</div>

Hi,

I have the latest flux version and I’ve tried everything I could find online but I still get this error when trying to use the DataLoader. Anyone encounter it before and found a fix (if it changes anything I’m running my code out of google colab).

Thanks!

---

<div class="post-metadata">

### Author: ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)
#### Post date: [June 15, 2022, 4:34am UTC](https://discourse.julialang.org/t/undefvarerror-dataloader-not-defined/82759/2 "2022-06-15T04:34:34Z")

</div>

Are you just trying to use it unqualified without explicitly importing it first? Note that this will not work:

```julia
using Flux

dl = DataLoader(...) # errors, because Flux does *not* export it

```

You’ll either have to include `(using|import) Flux: DataLoader` or prepend the module name as in `dl = Flux.DataLoader(..)`.

---

<div class="post-metadata">

### Author: ![soczek322](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soczek322/32/37166_2.png) [@soczek322](https://discourse.julialang.org/u/soczek322)
#### Post date: [June 15, 2022, 12:33pm UTC](https://discourse.julialang.org/t/undefvarerror-dataloader-not-defined/82759/3 "2022-06-15T12:33:55Z")

</div>

I’ve tried using Flux.Data: DataLoader  
using Flux: DataLoader  
both after import Flux and it still doesn’t work. It’s the only function from flux I’m having this problem with. Thanks!

---

<div class="post-metadata">

### Author: ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)
#### Post date: [June 15, 2022, 2:56pm UTC](https://discourse.julialang.org/t/undefvarerror-dataloader-not-defined/82759/4 "2022-06-15T14:56:06Z")

</div>

First things first, make sure your Flux version is up to date (at least v0.13). If not, then check your environment to see if any other dependencies are holding it back (you can search on Discourse for guides on how to do that). If everything looks there (and post your package version info here if it does so we can make sure), then post the _exact_ code, error + stacktrace you’re encountering when trying to use DataLoader. Per [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757), “doesn’t work” is not enough to work with 🙂
