Hi. I have a problem with Pytorch Hook function,
as I mentioned in title, my Hook demands current epoch for recording some statistics that changed by every epoch.
Is there any some tricky method for solving this problem?
For example,
my_model = some_net()
my_model.specific_layer.register_forward_hook(tricky_hook_for_recording_epoch)
for epoch in range(epoch_size):
for i, (data, label) in enumerate(dataloader):
output = my_model(data)
I’m using TensorBoard for Pytorch and this is why I need to record epoch.
Thanks for any answer!