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

Question regarding ProgressPrinter #139

Open
hv10 opened this issue Oct 12, 2022 · 5 comments
Open

Question regarding ProgressPrinter #139

hv10 opened this issue Oct 12, 2022 · 5 comments

Comments

@hv10
Copy link

hv10 commented Oct 12, 2022

Hi first off: wonderful package :)

I have some issues with the ProgressPrinter not showing up even when using the defaultcallbacks.

learner = Learner(model, loss; optimizer=opt, callbacks=[ToGPU()], usedefaultcallbacks=true)
FluxTraining.fit!(learner, epochs, (dl, val_dl)) # where dl, dl_val are both Flux.DataLoader objects

Do I need to do something specific when constructing the Learner which I have missed? From the code it seems like I would need to give it a Progress object, do I have to construct that myself? What requirements does my data-iterator have to fullfill to show up with the defaultcallbacks?

@hv10
Copy link
Author

hv10 commented Oct 12, 2022

Oh! I found the solution for now. I have to give in the data when the learner is constructed, so do:

learner = Learner(model, loss; optimizer=opt, callbacks=[ToGPU()], usedefaultcallbacks=true, data=(dl, dl_val))
FluxTraining.fit!(learner, epochs) 
# where dl, dl_val are both Flux.DataLoader objects

Somehow non-intuitive.

@lorenzoh
Copy link
Member

Hi Noel!

You can print the callbacks on a Learner using learner.callbacks.cbs, in case you want to check if one is there.

There are two ways of passing in data:

  • during construction, i.e. Learner(...; data =...)
  • when fitting, i.e. fit!(learner, epochs, dl)

Are you saying that in the latter case, the ProgressPrinter does not work?

@hv10
Copy link
Author

hv10 commented Oct 12, 2022

Yes, exactly that. :)
When constructing in the first way the ProgressPrinter works as expected, in the second case it does only print epoch, phase and some dots (as expected when ProgressPrintergot initialized with nothing on construction of the learner).

@hv10
Copy link
Author

hv10 commented Oct 12, 2022

It seems like this line does not work as I would expect it to.

dataiter = get(learner.data, phasedataiter(phase), nothing)

It seems like it always returns nothing, in the case where data is passed to .fit!()

@lorenzoh
Copy link
Member

Will look into it and let you know. Thanks for reporting the issue 👍

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

No branches or pull requests

2 participants