aicenter / GenerativeModels.jl

Generative Models with trainable conditional distributions in Julia!
MIT License
31 stars 3 forks source link

Broken gpu macro #72

Closed vitskvara closed 4 years ago

vitskvara commented 4 years ago

With the latest changes in ConditionalDists, the gpu macro is broken:

model = VAE(ldim, CMeanVarGaussian{DiagVar}(Dense(3,4)), CMeanVarGaussian{ScalarVar}(Dense(2,4))) |> gpu
ERROR: MethodError: Cannot `convert` an object of type Dense{typeof(identity),CuArray{Float32,2,Nothing},CuArray{Float32,1,Nothing}} to an object of type Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}
Closest candidates are:
  convert(::Type{T}, ::T) where T at essentials.jl:168
  Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}(::Any, ::Any, ::Any) where {F, S, T} at /home/vit/.julia/packages/Flux/oObnA/src/layers/basic.jl:86
Stacktrace:
 [1] CMeanVarGaussian{DiagVar,Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}}(::Dense{typeof(identity),CuArray{Float32,2,Nothing},CuArray{Float32,1,Nothing}}) at /home/vit/.julia/dev/ConditionalDists/src/cmeanvar_gaussian.jl:34
...
nmheim commented 4 years ago

Here we go again ^^ I'm travelling for the next 18 hours, so if you want to fix it go ahead :) looks like its trying to construct the cuarray versions with the old type signature for some reason...

vitskvara commented 4 years ago

It also seems to have broken training even if the mappings are moved to gpu before construction of the model. Unfortunately I am not sure how to fix this.

vitskvara commented 4 years ago

This is actually an issue with ConditionalDists.jl, so I'll close it here and open it there.