FluxML / GeometricFlux.jl

Geometric Deep Learning for Flux
https://fluxml.ai/GeometricFlux.jl/stable/
MIT License
350 stars 29 forks source link

Fix neural GDE example #268

Closed yuehhua closed 2 years ago

yuehhua commented 2 years ago

Closes #264, and related to SciML/DiffEqFlux.jl#640 and SciML/DiffEqFlux.jl#609.

yuehhua commented 2 years ago

It seems that there are something missing I didn't figure out while training on GPU.

$ /opt/julia-1.7.2/bin/julia --proj -i examples/gde.jl 
[ Info: Training on GPU
┌ Warning: Number of observations less than batchsize, decreasing the batchsize to 32
└ @ Flux.Data ~/.julia/packages/Flux/qAdFM/src/data/dataloader.jl:82
[ Info: Start Training, total 200 epochs
[ Info: Epoch 1
┌ Warning: Expected 7344086 params, got 272
└ @ Flux ~/.julia/packages/Flux/qAdFM/src/utils.jl:650
ERROR: LoadError: DimensionMismatch("array could not be broadcast to match destination")
Stacktrace:
  [1] check_broadcast_shape
    @ ./broadcast.jl:540 [inlined]
  [2] check_broadcast_axes
    @ ./broadcast.jl:543 [inlined]
  [3] instantiate
    @ ./broadcast.jl:284 [inlined]
  [4] materialize!(dest::CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}, x::CuArray{Float32, 1, CUDA.Mem.DeviceBuffer})
    @ Base.Broadcast ./broadcast.jl:864
yuehhua commented 2 years ago

OK, it works now.