Open montyvesselinov opened 5 years ago
I had the same issue. The problem was in 'sample_noise' function. It received a Float32 array, but returned Float64. Fixed it by: `function sample_noise(atype,zdim,nsamples,mu=0.5,sigma=0.5)
noise = randn(zdim,nsamples)
normalized = convert(atype, (noise .- mu) ./ sigma)
end`
After that I got some conv4(...) similar error regarding Float32 and Float64, and that was because there are a lot of functions with a default 'alpha = 0.2' parameter which is Float64. Forced all those to: alpha=Float32(0.2) and now it works.
Please keep in mind that my code was tested on CPU(not GPU with KnetArrays) and it is more or less a workaround because all these forced conversions should be made to accomodate whichever 'atype' the user chooses(and module supports of course).