basenji icon indicating copy to clipboard operation
basenji copied to clipboard

TypeError: __init__() takes 1 positional argument but 2 were given

Open octolis opened this issue 6 years ago • 7 comments

Hi, I'm trying to explore Akita but when loading the model I get the following error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-70b692f42586> in <module>
     10 target_length = params_model['target_length']
     11 target_crop = params_model['target_crop']
---> 12 seqnn_model = seqnn.SeqNN(params_model)

TypeError: __init__() takes 1 positional argument but 2 were given

As I understand the error is produced from basenji but I couldn't find out what's wrong with it. What can be the reason?

octolis avatar Feb 10 '20 12:02 octolis

Which script are you using and which branch of the code? You need to be on "tf2_hic" for the akita model

davek44 avatar Feb 12 '20 19:02 davek44

Hi, sorry for the long response. I'm using explore_model.py from 'tf2_hic' branch ( https://github.com/calico/basenji/blob/tf2_hic/manuscripts/akita/explore_model.ipynb )

octolis avatar Mar 12 '20 08:03 octolis

Could you try with tensorflow version 1.15? (Pip install tensorflow==1.15) Thanks!

On Thu, Mar 12, 2020, 1:51 AM octolis [email protected] wrote:

Hi, sorry for the long response. I'm using explore_model.py from 'tf2_hic' branch ( https://github.com/calico/basenji/blob/tf2_hic/manuscripts/akita/explore_model.ipynb )

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/calico/basenji/issues/58#issuecomment-598073297, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEV7GZLYDQSCJILOTX7LNOLRHCPATANCNFSM4KSNQHSA .

gfudenberg avatar Mar 12 '20 17:03 gfudenberg

Pip install tensorflow==1.15

Still the same error, unfortunately

octolis avatar Mar 13 '20 08:03 octolis

Do you also have Basenji from the master branch installed? The error suggests that it's trying to use SeqNN from a previous version.

You can check which code it's using with: import basenji print( basenji.__path__)

davek44 avatar Mar 13 '20 23:03 davek44

Yes, I cloned the repo from the master branch (just copied the link while being on the master branch https://github.com/calico/basenji.git ). But I tried to reinstall it and got the following error in the terminal:

zip_safe flag not set; analyzing archive contents...
__pycache__.pyBigWig.cpython-37: module references __file__
pyBigWigTest.__pycache__.test.cpython-37: module references __file__
No eggs found in /tmp/easy_install-6m5p84oh/pyBigWig-0.3.17/egg-dist-tmp-2g_486rh (setup script problem?)
error: The 'pyBigWig' distribution was not found and is required by basenji

I also tried to check the code as you suggested and got the following:

import basenji
print(basenji.__path__)

_NamespacePath(['/home/ishtar/basenji/basenji'])

octolis avatar Mar 16 '20 08:03 octolis

Akita lives in the tf2_hic branch. Clone that and try again.

pyBigWig is only required for some of the scripts that write BigWig files, so you likely won't need it. If you do, try installing manually with anaconda or pip.

davek44 avatar Mar 20 '20 05:03 davek44