-
-
Notifications
You must be signed in to change notification settings - Fork 611
Closed
Description
CUDNNError: CUDNN_STATUS_BAD_PARAM occurs during training with gpu. Single evaluation of the loss works and training with cpu works as well. X
is a vector of Array{Float32,2}(6,50)
and and Y
is Array{Float32,2}(1,1).
Julia version and packages:
Julia v1.5.2
Flux v0.11.1
CUDA v1.3.3
function prepare_time_series_data_4_flux(X,Y)
num_batches = length(X)
x = Vector{Array{Float32}}(undef, num_batches)
y = Vector{Array{Float32}}(undef, num_batches)
for i in 1:length(X)
x[i] = Float32.(reshape(X[i], size(X[i],2), size(X[i], 1)))
y[i] = Float32.(reshape(Y[i], size(Y[i], 2), size(Y[i], 1)))
end
return x, y
end
gpu_or_cpu = gpu
X, Y = prepare_time_series_data_4_flux(X_train_batched, Y_train_batched)
X = X |> gpu_or_cpu
Y = Y |> gpu_or_cpu
data = (X, vcat(Y...))
X, Y = prepare_time_series_data_4_flux(X_val_batched, Y_val_batched)
X = X |> gpu_or_cpu
Y = Y |> gpu_or_cpu
data_test = (X, vcat(Y...))
opt = ADAM(0.001, (0.9, 0.999))
function loss(X,Y)
Flux.reset!(model)
mse_val = sum(abs2.(Y.-vcat(model.(X)...)[:, end]))
return mse_val
end
model = Chain(LSTM(6, 70), LSTM(70, 70), LSTM(70, 70), Dense(70, 1, relu)) |> gpu_or_cpu
ps = Flux.params(model)
Flux.reset!(model)
loss(data...)
@time Flux.train!(loss, ps, [data], opt)
Metadata
Metadata
Assignees
Labels
No labels