# A implementation of ResNet-18 uses lot of GPU memory

**URL:** https://discourse.julialang.org/t/a-implementation-of-resnet-18-uses-lot-of-gpu-memory/36389
**Category:** Machine Learning
**Tags:** question, flux
**Created:** [March 23, 2020, 12:08pm UTC](https://discourse.julialang.org/t/a-implementation-of-resnet-18-uses-lot-of-gpu-memory/36389 "2020-03-23T12:08:50Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![OTapio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/otapio/32/13656_2.png) [@OTapio](https://discourse.julialang.org/u/OTapio)
#### Post date: [March 30, 2020, 3:31pm UTC](https://discourse.julialang.org/t/a-implementation-of-resnet-18-uses-lot-of-gpu-memory/36389/10 "2020-03-30T15:31:11Z")

</div>

I did couple of experiments and it seems that the ConvTranspose seems to be culprit here. Just compare performances with these two models

```julia
m = Chain(
  ConvTranspose((n, n), 3 => 3, stride = n),
  Conv((7,7), 3=>64, pad = (3,3), stride = (2,2)),
  MeanPool((7,7)),
  x -> reshape(x, :, size(x,4)),
  Dense(512*32, 10),
  softmax,
) |> gpu

```

```julia
m = Chain(
  Conv((7,7), 3=>64, pad = (3,3), stride = (2,2)),
  MeanPool((7,7)),
  x -> reshape(x, :, size(x,4)),
 Dense(256, 512*32),
  Dense(512*32, 10),
  softmax,
) |> gpu

```

---

_[View the full topic](https://discourse.julialang.org/t/a-implementation-of-resnet-18-uses-lot-of-gpu-memory/36389)._
