denizyuret/Knet.jl

Error converting CuArray to KnetArray

Closed this issue · 3 comments

julia> KnetArray(CuArray(rand(2)))
ERROR: UndefVarError: Knet not defined
Stacktrace:
 [1] KnetArray(::CuArray{Float64,1}) at /home/ngphuoc/.julia/packages/Knet/8aEsn/src/knetarrays/karray.jl:156
 [2] top-level scope at REPL[50]:1

Assuming that is the entirety of your code, you need to import the Knet package:

julia> using Pkg # only need to do this once
julia> Pkg.add("Knet") # only need to do this once
julia> using Knet

Also, don't need to convert CuArrays -- the following will suffice:

julia> KnetArray(rand(2))

Fixed in latest master, please check.

It works. Many thanks.

@andevellicus I need the conversion to use functionalities supported in one or another. I am waiting for when Knet completely switches to CuArray.