deeplog.predict() isnt forwading the input
Closed this issue · 3 comments
When executing your example script, I always get the same top 3 predictions. Than I took a look into the torchtrain predict function (module.py) and there nothing gets forwarded through the trained network.
You just pass the batch to the torch constructor, which does nothing but initializing and then append this batch to the result without forwarding anything.
Maybe I understand something wrong, but I think this isn't working at all.
Instead of using the forward()
method itself, PyTorch recommends calling the entire module (i.e., self
in this case) instead:
Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
See https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.forward
Hmm, weird. I think I have found the problem, the LogSoftmax
layer was missing in the implementation. I fixed it with the latest push so now it should work again.
Thanks for spotting this and let me know if there are other problems!