I made some obvious syntax changes to get the example to run under julia 1.3/Knet 132,
but it fails with this error
ERROR: LoadError: MethodError: Cannot `convert` an object of type UnitRange{Int64} to an object of type Colon
Closest candidates are:
convert(::Type{T}, ::T) where T at essentials.jl:167
Stacktrace:
[1] convert(::Type{Tuple{Colon,UnitRange{Int64},Colon,Colon}}, ::Tuple{UnitRange{Int64},Colon,Colon,Colon}) at ./essentials.jl:304
[2] setindex!(::Array{Tuple{Colon,UnitRange{Int64},Colon,Colon},1}, ::Tuple{UnitRange{Int64},Colon,Colon,Colon}, ::Int64) at ./array.jl:766
[3] copyto!(::Array{Tuple{Colon,UnitRange{Int64},Colon,Colon},1}, ::Int64, ::Array{Tuple{UnitRange{Int64},Colon,Colon,Colon},1}, ::Int64, ::Int64) at ./abstractarray.jl:842
[4] append!(::Array{Tuple{Colon,UnitRange{Int64},Colon,Colon},1}, ::Array{Tuple{UnitRange{Int64},Colon,Colon,Colon},1}) at ./array.jl:895
[5] addto!(::AutoGrad.Sparse{Float64,4}, ::AutoGrad.Sparse{Float64,4}) at /root/.julia/packages/AutoGrad/pTNVv/src/addto.jl:44
[6] #differentiate#3(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(AutoGrad.differentiate), ::Function, ::Param{KnetArray{Float64,4}}, ::Vararg{Any,N} where N) at /root/.julia/packages/AutoGrad/pTNVv/src/core.jl:166
[7] differentiate(::Function, ::Param{KnetArray{Float64,4}}, ::Vararg{Any,N} where N) at /root/.julia/packages/AutoGrad/pTNVv/src/core.jl:135
[8] (::getfield(AutoGrad, Symbol("##gradfun#6#8")){typeof(loss),Int64,Bool})(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::getfield(AutoGrad, Symbol("#gradfun#7")){getfield(AutoGrad, Symbol("##gradfun#6#8")){typeof(loss),Int64,Bool}}, ::KnetArray{Float64,4}, ::Vararg{Any,N} where N) at /root/.julia/packages/AutoGrad/pTNVv/src/core.jl:225
[9] (::getfield(AutoGrad, Symbol("#gradfun#7")){getfield(AutoGrad, Symbol("##gradfun#6#8")){typeof(loss),Int64,Bool}})(::KnetArray{Float64,4}, ::Vararg{Any,N} where N) at /root/.julia/packages/AutoGrad/pTNVv/src/core.jl:221
[10] style_transfer(::String, ::String, ::Int64, ::Int64, ::Int64, ::Float64, ::NTuple{5,Int64}, ::Array{Float64,1}, ::Float64, ::Bool) at /work/neural_style_transfer.jl:365
[11] style_transfer(::String, ::String, ::Int64, ::Int64, ::Int64, ::Float64, ::NTuple{5,Int64}, ::Array{Float64,1}, ::Float64) at /work/neural_style_transfer.jl:329
[12] top-level scope at util.jl:156
[13] include at ./boot.jl:328 [inlined]
[14] include_relative(::Module, ::String) at ./loading.jl:1094
[15] include(::Module, ::String) at ./Base.jl:31
[16] include(::String) at ./client.jl:431
[17] top-level scope at REPL[1]:1
in expression starting at /work/neural_style_transfer.jl:397