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

Error report during model training and explanation #7

Open
XuanrZhang opened this issue May 16, 2023 · 3 comments
Open

Error report during model training and explanation #7

XuanrZhang opened this issue May 16, 2023 · 3 comments

Comments

@XuanrZhang
Copy link

Hi @fransilvion,

Thanks for the useful tool.

I've installed explainn 0.1.5 by pip install explainn==0.1.5. and followed the github instruction to train model on test set (you provided).

for model training, I ran into two errors when I call train.train_explainn() function.

Error1: patience parameter isn't available.
Error2: checkpoint can not be set as 0.

I gave it a go without using these two parameters, which works.

When I did the interpretation, I tried to run the code below.

filter_size =19
pwms = interpretation.get_pwms_explainn(activations, data_inp, filter_size)

But I ran into the below error.
TypeError Traceback (most recent call last)
in
28 activations = interpretation.get_explainn_unit_activations(data_loader, model, device)
29 filter_size = 19
---> 30 pwms = interpretation.get_pwms_explainn(activations, data_inp, filter_size)
31 meme_file = "/g/data/zk16/xzhang/ExplaiNN/explainn_filters.meme"
32 interpretation.pwm_to_meme(pwms, meme_file)

TypeError: get_pwms_explainn() missing 1 required positional argument: 'filter_size'

I did assign filter_size argument, but it still popped up argument miss error.

Any suggestion for fix this? Thanks in advance!

Best,
Xuan

@oriolfornes
Copy link
Contributor

Hi Xuan,

Please accept our apologies. I introduced some modifications to the code a while ago and just pushed the code recently during the reviewing process of the manuscript.

While I try to update the code to PyPI, you can install the updated code via python setup.py install.

I have also introduced scripts to train, test and interpret ExplaiNN models which are provided in the scripts folder. Instead of running the code through a Jupyter notebook, the scripts enable execution of ExplaiNN through the command line. For more information, you can check the tutorial that I provide under data/tutorial.

Sorry for the inconveniences.

@XuanrZhang
Copy link
Author

Hi @oriolfornes,

Thanks for your reply. I've re-installed the updated version and followed the tutorial (slide.pdf) to learn the process of Explainn.

When I tested example 1 (you provided in the slide), I have stuck again before the model training( page 14 of the slide).
When I ran fasta2explainn.py, I got the below errors. There are small bugs in the code. Would you like to have a look?

Traceback (most recent call last):
  File "../../scripts/parsers/fasta2explainn.py", line 179, in <module>
    cli()
  File "/g/data/zk16/xzhang/miniconda3/envs/dnabert_gpu/lib/python3.6/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/g/data/zk16/xzhang/miniconda3/envs/dnabert_gpu/lib/python3.6/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/g/data/zk16/xzhang/miniconda3/envs/dnabert_gpu/lib/python3.6/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/g/data/zk16/xzhang/miniconda3/envs/dnabert_gpu/lib/python3.6/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "../../scripts/parsers/fasta2explainn.py", line 86, in cli
    args["output_dir"], args["prefix"], args["random_seed"], args["splits"])
  File "../../scripts/parsers/fasta2explainn.py", line 147, in _to_ExplaiNN
    df2 = pd.DataFrame(data, columns=list(range(len(data[0]))))
IndexError: list index out of range

Thanks in advance!

@oriolfornes
Copy link
Contributor

oriolfornes commented Aug 1, 2023

Hi, my apologies for the long wait.

A couple of things:

  1. I have updated the installation. It is no longer through pip (I do not have the right permissions to push the changes to pip), but through git clone and then python setup.py install; please see the README.md file.
  2. I have updated all the parsers, trainers, and interpreters; have not tested them all, but they should work fine.

Let me know if you encounter any additional problems!

Thanks for your patience!

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