|
122 | 122 | end
|
123 | 123 | end
|
124 | 124 |
|
| 125 | +@testset "Res2Net" begin |
| 126 | + @testset for (base_width, scale) in [(26, 4), (48, 2), (14, 8), (26, 6), (26, 8)] |
| 127 | + m = Res2Net(50; base_width, scale) |
| 128 | + @test size(m(x_224)) == (1000, 1) |
| 129 | + if (Res2Net, depth, cardinality, base_width) in PRETRAINED_MODELS |
| 130 | + @test acctest(Res2Net(depth, pretrain = true)) |
| 131 | + else |
| 132 | + @test_throws ArgumentError Res2Net(depth, pretrain = true) |
| 133 | + end |
| 134 | + @test gradtest(m, x_224) |
| 135 | + _gc() |
| 136 | + end |
| 137 | + @testset for (base_width, scale) in [(26, 4)] |
| 138 | + m = Res2Net(101; base_width, scale) |
| 139 | + @test size(m(x_224)) == (1000, 1) |
| 140 | + if (Res2Net, depth, cardinality, base_width) in PRETRAINED_MODELS |
| 141 | + @test acctest(Res2Net(depth, pretrain = true)) |
| 142 | + else |
| 143 | + @test_throws ArgumentError Res2Net(depth, pretrain = true) |
| 144 | + end |
| 145 | + @test gradtest(m, x_224) |
| 146 | + _gc() |
| 147 | + end |
| 148 | +end |
| 149 | + |
| 150 | +@testset "Res2NeXt" begin |
| 151 | + @testset for depth in [50, 101] |
| 152 | + m = Res2NeXt(depth) |
| 153 | + @test size(m(x_224)) == (1000, 1) |
| 154 | + if (Res2NeXt, depth) in PRETRAINED_MODELS |
| 155 | + @test acctest(Res2NeXt(depth, pretrain = true)) |
| 156 | + else |
| 157 | + @test_throws ArgumentError Res2NeXt(depth, pretrain = true) |
| 158 | + end |
| 159 | + @test gradtest(m, x_224) |
| 160 | + _gc() |
| 161 | + end |
| 162 | +end |
| 163 | + |
125 | 164 | @testset "EfficientNet" begin
|
126 | 165 | @testset "EfficientNet($config)" for config in [:b0, :b1, :b2, :b3, :b4, :b5] #:b6, :b7, :b8]
|
127 | 166 | # preferred image resolution scaling
|
|
0 commit comments