Thijsvanede/DeepLog

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.

Screenshot_20220707_153455

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

Ok but then I still dont quite understand why I get the same top 3 predictions, when running your hdfs_example.py on your HDFS datasets:

Screenshot_20220707_172946

Do you have any idea?

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!