Closed elboyran closed 4 years ago
Finally I have figured it out- I have been using the loading from file method wrongly!
The correct way is:
PatternNet_analyzer = PatternNet_analyzer.load_npz(fname)
Would have been nice and very useful for the practical usage to have such example in the notebooks!
This issue is similar to #155 , but the comments there did not help, therefore I open a new issue.
I am very glad that this toolbox exists! Currently trying to perform some simple experiments using it.
I'm especially interested in attribution methods, such as PatternNet etc. Training the PatterNet analyzer, every time, however, is time wasting and does not make much sense. Therefore I used the
save_npz
andload_npz
functionality provided (on many analyzers). However, only very few analyzers are working again after loading and unfortunately the PatternNet does not work.An example notebook which works just fine with training (the first time) the analyzer can be found here.
If I want, however, to run the notebook again by loading the trained analyzer, it does not work. Below are the errors I'm getting while running the last cell of the Notebook above (on Ubuntu 18.04 VM):
It seems like the PaterNet analyzer is not constructed properly after loading, but I find hard to debug. It seems the state and name are loaded properly after load_npz, but later something gets messed up maybe by creating a new analyzer to be filled with the pre-trained weights.
Is this code then the correct use of your toolbox for reusing a per-trained analyzer?
The problem is even bigger- only for very few of all supported methods it is possible to save the analyzer and reuse it later again. Cell 8 of this notebook lists in the comments some of the problems I've encountered with saving and loading.
@albermax , @sebastian-lapuschkin , I would appreciate a lot if you can help me with the issue!