# ERROR: BoundsError: attempt to access "fc6"

**URL:** <https://discourse.julialang.org/t/error-boundserror-attempt-to-access-fc6/17333>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 9, 2018, 3:37am UTC](https://discourse.julialang.org/t/error-boundserror-attempt-to-access-fc6/17333 "2018-11-09T03:37:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lannisite110](https://avatars.discourse-cdn.com/v4/letter/l/df705f/32.png) [@lannisite110](https://discourse.julialang.org/u/lannisite110)\
**Post date:** [November 9, 2018, 3:37am UTC](https://discourse.julialang.org/t/error-boundserror-attempt-to-access-fc6/17333/1 "2018-11-09T03:37:58Z")

</div>

when i read the trained parameter of vgg16, there occurs some problem.

```julia
julia> function getWeights(file)
           layers=get(file,"layers","")
           meta=get(file,"meta","")
           weights=Dict()
           weights["par"]=16
           for la in layers
               name=SubString(get(la,"name",""),1,4)
               layerth=SubString(get(la,"name",""),5,5)
               lastsyn=SubString(get(la,"name",""),5)
               if name=="conv"
                   weights[string("w",lastsyn)]=la["weights"][1]
                   weights[string("b",lastsyn)]=la["weights"][2]
               elseif name=="fc6"
                   weights["w6"]=la["weights"][1]
                   weights["b6"]=la["weights"][2]
                   return weights
               end
       # println(la["name"])
           end

       end
getWeights (generic function with 1 method)

julia> weight=getWeights(file);
ERROR: BoundsError: attempt to access "fc6"
  at index [1:4]
Stacktrace:
 [1] checkbounds at ./strings/basic.jl:193 [inlined]
 [2] Type at ./strings/substring.jl:30 [inlined]
 [3] SubString(::String, ::Int64, ::Int64) at ./strings/substring.jl:38
 [4] getWeights(::Dict{String,Any}) at ./REPL[249]:7
 [5] top-level scope at none:0

```
