Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated cGan_mnist example dependencies, some issues still #263

Merged
merged 9 commits into from
Dec 15, 2020

Conversation

adinhobl
Copy link
Contributor

I updated the dependencies for the cdcgan_mnist example to be more modern.

Three other things:

  1. I still occasionally get an warning like below. It doesn't happen every time I run it, but sometimes it does. I don't know if there is something for me to fix.
[ Info: Epoch 1
┌ Warning: calls to Base intrinsics might be GPU incompatible
│   exception =
│    You called log1p(x::Float32) in Base.Math at special/log.jl:360, maybe you intended to call log1p(x::Float32) in CUDA at /home/andrew/.julia/packages/CUDA/YeS8q/src/device/intrinsics/math.jl:85 instead?
│    Stacktrace:
│     [1] log1p at special/log.jl:360
│     [2] broadcast_kernel at /home/andrew/.julia/packages/GPUArrays/jhRU7/src/host/broadcast.jl:59
└ @ GPUCompiler ~/.julia/packages/GPUCompiler/uTpNx/src/irgen.jl:68
[ Info: Train step 0, Discriminator loss = 1.3628006, Generator loss = 0.6890712
[ Info: Epoch 2
[ Info: Epoch 3
[ Info: Train step 1000, Discriminator loss = 1.1395278, Generator loss = 1.0239918
  1. I included a line in the load_data function to actually download the data. Without it, the prompt to download the data will appear, but I don't think there's a way for me to respond, so it gets stuck. The way I have it now, it will download data every time the script is run, which isn't optimal either.
function load_data(hparams)
    MLDatasets.MNIST.download(i_accept_the_terms_of_use=true)
  1. I also removed the model output images from the repository. I'm not sure if it's better to have them or not, open to suggestions.

@CarloLucibello
Copy link
Member

Fix for 1.: In newer versions of julia, loss functions should not be broadcasted and also perform reduction (mean by default). So mean(logitbinarycrossentropy.(fake_output, 0f0)) becomes logitbinarycrossentropy(fake_output, 0f0)

@@ -75,6 +76,8 @@ function (m::Generator)(x, y)
end

function load_data(hparams)
MLDatasets.MNIST.download(i_accept_the_terms_of_use=true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove this. It's not needed when including the script from a REPL (julia's typical usage)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. As someone who ran this using the VSCode extension, it just printed out the text and there was no way for me to respond that "yes please download it". I suspect that anyone who doesn't use the REPL by default (mostly newer users) could stumble in the same spot. Should I add a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That probably also explains what cd(@__DIR__) is doing in all these files 😅 excuse my ignorance

@CarloLucibello
Copy link
Member

  1. I also removed the model output images from the repository. I'm not sure if it's better to have them or not, open to suggestions.

Let's keep them! Or even better, replace them with the ones you obtain from a run on your machine. Keeping the generated images for comparison safeguards us from visual rquality regressions

@adinhobl
Copy link
Contributor Author

adinhobl commented Dec 1, 2020

Note that in the most recent commits I had to change the global .gitignore to include the output images. Somehow the previous output images were included in the repo, although both the global .gitignore and the one in the cdcgan folder both excluded the output folder... Not sure how they ended up there to begin with (-f flag?). The above commit spam was me figuring that out.

@adinhobl
Copy link
Contributor Author

bump :)

@CarloLucibello
Copy link
Member

thank you for this!

@CarloLucibello CarloLucibello merged commit 6a4075a into FluxML:master Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants