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

Running Example, pandas/pickle issues #33

Open
CFGrote opened this issue Jan 7, 2021 · 2 comments
Open

Running Example, pandas/pickle issues #33

CFGrote opened this issue Jan 7, 2021 · 2 comments

Comments

@CFGrote
Copy link

CFGrote commented Jan 7, 2021

Hi there,
first. thanks for making your code accessible, this is very useful.

I run into the problem detailed below when running the example from the README.

OS / python env setup:

  • OS: ubuntu 18.04
  • env: conda with cudatoolkit=9.0, cudnn, python=3.6 and all dependencies according to requirements.txt

deepgoplus installation:

  • clone deepgoplus repo, on commit c309ade
  • installed deepgoplus with
python setup.py install

Download data

$> wget https://deepgo.cbrc.kaust.edu.sa/data/data.tar.gz 

and unpack into data/data directory.

Get a test sequence from training data

$> head -2 data/data/test_data.fa > test_single.fa                                           
$> cat test_single.fa                                                                          
>KR103_HUMAN
MATSTMSVCSSAYSDSWQVDACPESCCEPPCCATSCCAPAPCLTLVCTPVSCVSSPCCQAACEPSPCQSGCTSSCTPSCCQQSSCQPACCTSSPCQQACCVPVCCKPVCCVPVCCKPVCCKPICCVPVCSGASSSCCQQSSRQPACCTTSCCRPSSSVSLLCRPVCRSTCCVPIPSCCAPASTCQPSCCRPASCVSLLCRPTCSRLSSACCGLSSGQKSSC

Run deepgoplus (here's where the problems start)

  • run deepgoplus:
$> deepgoplus --data-root data/data --in-file test_single.fa                                  [master] 
Traceback (most recent call last):
  File "XXX/lib/python3.6/site-packages/pandas/io/pickle.py", line 166, in try_read
    return read_wrapper(lambda f: pkl.load(f))
  File "XXX/lib/python3.6/site-packages/pandas/io/pickle.py", line 149, in read_wrapper
    return func(f)
  File "XXX/lib/python3.6/site-packages/pandas/io/pickle.py", line 166, in <lambda>
    return read_wrapper(lambda f: pkl.load(f))
ValueError: unsupported pickle protocol: 5
  • I assume the pickle files were written with pickle protocol 5, convert to protocol 4:
    In a different python environment (with pandas version 1.0.5)
import pandas, glob
for pkl in glob.glob('data/data/*.pkl'):
    pandas.read_pickle(pkl).to_pickle(pkl, protocol=4)
  • This gets rid of the error but another one now comes up (switch back to py3.6/pandas0.23 env)
$> deepgoplus --data-root data/data --in-file test_single.fa                                  [master] 
Traceback (most recent call last):
  File "XXX/bin/deepgoplus", line 42, in <module>
    sys.exit(load_entry_point('deepgoplus==1.0.0', 'console_scripts', 'deepgoplus')())
  File "XXX/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "XXX/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "XXX/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "XXX/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "XXX/lib/python3.6/site-packages/deepgoplus-1.0.0-py3.6.egg/deepgoplus/main.py", line 63, in main
  File "XXX/lib/python3.6/site-packages/pandas/core/frame.py", line 2668, in __getitem__
    is_mi_columns = isinstance(self.columns, MultiIndex)
  File "XXX/lib/python3.6/site-packages/pandas/core/generic.py", line 4372, in __getattr__
    return object.__getattribute__(self, name)
  File "pandas/_libs/properties.pyx", line 65, in pandas._libs.properties.AxisProperty.__get__
  File "XXX/lib/python3.6/site-packages/pandas/core/generic.py", line 4372, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute '_data'
  • At this point I gave up. Have the requirements changed but documentation is not updated? Any help would be greatly appreciated, thanks in advance!
@CFGrote
Copy link
Author

CFGrote commented Jan 7, 2021

I found the following fix:

  • checkout PR Bump tensorflow-gpu from 1.12.0 to 2.3.1 #28
  • remove all version pinning in requirements.txt except for "tensorflow-gpu==2.3.1"
  • upgrade python to version 3.7
  • not install deepgoplus through pip or setup.py but use
python deepgoplus/main.py 

instead.

@coolmaksat
Copy link
Contributor

Hi,
Thank you for raising this issue and PR.
We will update the master branch soon.

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