Skip to content

Commit

Permalink
fix: check against NaNs in images
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Jan 5, 2025
1 parent cbf0d8d commit fafb9b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/DDIM/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ end

function save_images(output_dir, images::Vector{<:AbstractMatrix{<:RGB}})
for (i, img) in enumerate(images)
if any(isnan, img)
@warn "NaN image found in the generated images. Skipping..."
continue
end
save(joinpath(output_dir, "img_$(i).png"), img)
end
end
Expand Down

0 comments on commit fafb9b7

Please sign in to comment.