FluxML / FastAI.jl

Repository of best practices for deep learning in Julia, inspired by fastai
https://fluxml.ai/FastAI.jl
MIT License
589 stars 51 forks source link

Keypoint Regression example in documentation #218

Closed itan1 closed 2 years ago

itan1 commented 2 years ago

I was following the KeypointRegression example from the documentation and ran into the following two errors:

julia> using FastAI.FilePathsBase, FastAI.StaticArrays, FastAI.DLPipelines
ERROR: UndefVarError: DLPipelines not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/CUDA/Uurn4/src/initialization.jl:52

and

julia> task = BlockTask(
           (Image{2}(), Keypoints{2}(1)),
           (
               ProjectiveTransforms(sz, buffered=true, augmentations=augs_projection(max_warp=0)),
               ImagePreprocessing(),
               KeypointPreprocessing(sz),
           )
       )
ERROR: UndefVarError: FlipX not defined
Stacktrace:
 [1] augs_projection(; flipx::Bool, flipy::Bool, max_zoom::Float64, max_rotate::Float64, max_warp::Int64)
   @ FastAI.Vision ~/.julia/packages/FastAI/GAIqz/src/Vision/encodings/projective.jl:200
 [2] top-level scope
   @ REPL[7]:1
 [3] top-level scope
   @ ~/.julia/packages/CUDA/Uurn4/src/initialization.jl:52

I think the first error can be solved simply by removing the FastAI.DLPipelines import.

Regarding the second error, FlipX alone can also not be found in the REPL but with the prefix DataAugmentation. it works.

julia> DataAugmentation.FlipX
FlipX (generic function with 1 method)

julia> FlipX
ERROR: UndefVarError: FlipX not defined
Stacktrace:
 [1] top-level scope
   @ :0
 [2] top-level scope
   @ ~/.julia/packages/CUDA/Uurn4/src/initialization.jl:52

I'd be happy to submit a PR fixing both issues. Is this prefix ^ also how you would solve it or do you prefer something different?

Julia version: 1.7.2 FastAI version: 0.4.0 Platform: macOS on M1

itan1 commented 2 years ago

The second error related to FlipX and augs_projection() is resolved now, I'll open a PR to fix the remaining issues in the documentation for Keypoint Regression

itan1 commented 2 years ago

Resolved with #221