[pymvpa] LinearCSVMC() error with python 2.7 but not 2.6?

Edmund Chong edmund.w.chong at gmail.com
Fri Sep 7 17:01:49 UTC 2012


Hi Yarik,

For both systems:

issubclass(LinearCSVMC,libsvm.SVM)
is True,
and issubclass(LinearCSVMC,sg.SVM)
is False.


another thing you could if that was under ipython,
> enable debug mode by entering
>
> pdb
>
> so it would jump into pdb whenever failure occurs... and then share output
> of
>
> print dist_samples.shape
> print shape
>

ipdb> print dist_samples.shape
(0, 1)
ipdb> print shape
(0,)


could you share complete snippet of your code and the dataset (check --
> may be it fails also with  a small portion of it, e.g. fds1[:, :10]).
> you can easily share it by saving via h5save
>


This is where it gets a little strange: so I saved my fds1 to hdf5 format.
When I loaded it back, the classifier actually works (on the non-working
system)! So in my script I added a few lines that saved and then loaded the
dataset just before applying the classifier -- I obtain exactly the same
results as on the working system. So I guess it would not make sense to
share the hdf5 file with you -- would you like the .nii instead? And here's
the code i used for the classifier:

    repeater = Repeater(count=200)

    partitioner=ChainNode([NFoldPartitioner(cvtype=1),
                      Balancer(attr='targets',
                               count=1, # for real data > 1
                               limit='partitions',
                               apply_selection=True
                               )],
                     space='partitions')

    clf = LinearCSVMC() #choice of classifier
    permutator = AttributePermutator('targets', limit={'partitions': 1},
count=1)
    null_cv = CrossValidation(
    clf,
    ChainNode([partitioner, permutator], space=partitioner.get_space()),
    errorfx=mean_mismatch_error)
    distr_est = MCNullDist(repeater, tail='left', measure=null_cv,
               enable_ca=['dist_samples'])

    cvte = CrossValidation(clf, partitioner,
                 errorfx=mean_mismatch_error,
                 null_dist=distr_est,
                 enable_ca=['stats'])



also what is the output of
>
> mvpa2.wtf() # where fails
>
>

for the working system:


Current date:   2012-09-07 12:59
PyMVPA:
 Version:       2.1.0
 Hash:          828f4b4bea2488f8c7e3f6c2446a445d77325338
 Path:          /usr/lib/pymodules/python2.6/mvpa2/__init__.pyc
 Version control (GIT):
 GIT information could not be obtained due
"/usr/lib/pymodules/python2.6/mvpa2/.. is not under GIT"
SYSTEM:
 OS:            posix Linux 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16
19:52:42 UTC 2010
 Distribution:  Ubuntu/10.04/lucid
EXTERNALS:
 Present:       atlas_fsl, cPickle, ctypes, good
scipy.stats.rv_discrete.ppf, griddata, gzip, h5py, ipython, liblapack.so,
libsvm, libsvm verbosity control, lxml, matplotlib, nibabel, nose, numpy,
pylab, pylab plottable, pywt, pywt wp reconstruct, reportlab, running
ipython env, scipy, sg ge 0.6.4, sg ge 0.6.5, sg_fixedcachesize, shogun,
shogun.krr, shogun.mpd, shogun.svmocas, skl, weave
 Absent:        atlas_pymvpa, cran-energy, elasticnet, glmnet, good
scipy.stats.rdist, hcluster, lars, mass, mdp, mdp ge 2.4, nipy,
nipy.neurospin, openopt, pprocess, pywt wp reconstruct fixed, rpy2,
shogun.lightsvm, shogun.svrlight, statsmodels
 Versions of critical externals:
  shogun:full : 0.9.1_r4481_2009-11-16_10:14_
  shogun:rev  : 4481
  reportlab   : 2.4
  shogun      : 0.9.1
  nibabel     : 1.2.2
  matplotlib  : 0.99.1.1
  scipy       : 0.7.0
  ipython     : 0.10
  skl         : 0.11
  numpy       : 1.3.0
  ctypes      : 1.1.0
  matplotlib  : 0.99.1.1
  lxml        : 2.2.4
  nifti       : failed to query due to "nifti is not a known dependency
key."
  numpy       : 1.3.0
  pywt        : 0.1.7
  shogun      : v0.9.1_r4481_2009-11-16_10:14_
 Matplotlib backend: TkAgg
RUNTIME:
 PyMVPA Environment Variables:
   PyMVPA Runtime Configuration:
  [externals]
  have griddata = yes
  have pprocess = no
  have ipython = yes
  have cran-energy = no
  have good scipy.stats.rdist = no
  have pylab plottable = yes
  have pywt wp reconstruct = yes
  have ctypes = yes
  have lxml = yes
  have running ipython env = yes
  have nibabel = yes
  have sg_fixedcachesize = yes
  have elasticnet = no
  have shogun.mpd = yes
  have matplotlib = yes
  have pywt wp reconstruct fixed = no
  have scipy = yes
  have reportlab = yes
  have openopt = no
  have libsvm = yes
  have h5py = yes
  have liblapack.so = yes
  have weave = yes
  have atlas_fsl = yes
  have mdp = no
  have hcluster = no
  have sg ge 0.6.4 = yes
  have sg ge 0.6.5 = yes
  have good scipy.stats.rv_discrete.ppf = yes
  have skl = yes
  have mdp ge 2.4 = no
  have shogun.svrlight = no
  have shogun = yes
  have shogun.svmocas = yes
  have nipy = no
  have glmnet = no
  have nose = yes
  have mass = no
  have lars = no
  have libsvm verbosity control = yes
  have atlas_pymvpa = no
  have shogun.krr = yes
  have cpickle = yes
  have numpy = yes
  have pylab = yes
  have rpy2 = no
  have shogun.lightsvm = no
  have pywt = yes
  have statsmodels = no
  have gzip = yes
  have nipy.neurospin = no

  [general]
  verbose = 1
 Process Information:
  Name:    ipython
  State:    R (running)
  Tgid:    3040
  Pid:    3040
  PPid:    1691
  TracerPid:    0
  Uid:    1001    1001    1001    1001
  Gid:    1001    1001    1001    1001
  FDSize:    256
  Groups:    4 20 21 24 26 29 30 44 46 103 104 112 115 120 1001
  VmPeak:      697704 kB
  VmSize:      614156 kB
  VmLck:           0 kB
  VmHWM:      235484 kB
  VmRSS:      131248 kB
  VmData:      118084 kB
  VmStk:         244 kB
  VmExe:        2160 kB
  VmLib:       84924 kB
  VmPTE:        1156 kB
  Threads:    2
  SigQ:    0/16382
  SigPnd:    0000000000000000
  ShdPnd:    0000000000000000
  SigBlk:    0000000000000000
  SigIgn:    0000000001001000
  SigCgt:    0000000180000002
  CapInh:    0000000000000000
  CapPrm:    0000000000000000
  CapEff:    0000000000000000
  CapBnd:    ffffffffffffffff
  Cpus_allowed:    fff
  Cpus_allowed_list:    0-11
  Mems_allowed:    00000000,00000001
  Mems_allowed_list:    0
  voluntary_ctxt_switches:    801
  nonvoluntary_ctxt_switches:    2002

******************************************
for the non-working system:

Current date:   2012-09-07 13:00
PyMVPA:
 Version:       2.1.0
 Hash:          828f4b4bea2488f8c7e3f6c2446a445d77325338
 Path:          /usr/lib/pymodules/python2.7/mvpa2/__init__.py
 Version control (GIT):
 GIT information could not be obtained due
"/usr/lib/pymodules/python2.7/mvpa2/.. is not under GIT"
SYSTEM:
 OS:            posix Linux 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27
17:03:23 UTC 2012
 Distribution:  Ubuntu/12.04/precise
EXTERNALS:
 Present:       cPickle, ctypes, good scipy.stats.rdist, good
scipy.stats.rv_discrete.ppf, griddata, gzip, h5py, ipython, liblapack.so,
libsvm, libsvm verbosity control, lxml, matplotlib, mdp, mdp ge 2.4,
nibabel, nose, numpy, pylab, pylab plottable, pywt, pywt wp reconstruct,
reportlab, running ipython env, scipy, sg ge 0.6.4, sg ge 0.6.5,
sg_fixedcachesize, shogun, shogun.krr, shogun.mpd, shogun.svmocas, skl,
weave
 Absent:        atlas_fsl, atlas_pymvpa, cran-energy, elasticnet, glmnet,
hcluster, lars, mass, nipy, nipy.neurospin, openopt, pprocess, pywt wp
reconstruct fixed, rpy2, shogun.lightsvm, shogun.svrlight, statsmodels
 Versions of critical externals:
  shogun:full : 1.1.0_02ce3cd_2011-12-12_08:17_
  shogun:rev  : 2941901
  reportlab   : 2.5
  shogun      : 1.1.0
  nibabel     : 1.2.2
  matplotlib  : 1.1.1rc
  scipy       : 0.9.0
  ipython     : 0.12.1
  skl         : 0.11
  mdp         : 3.3
  numpy       : 1.6.1
  ctypes      : 1.1.0
  matplotlib  : 1.1.1rc
  lxml        : 2.3.2
  nifti       : failed to query due to "nifti is not a known dependency
key."
  numpy       : 1.6.1
  pywt        : 0.2.0
  shogun      : v1.1.0_02ce3cd_2011-12-12_08:17_
 Matplotlib backend: TkAgg
RUNTIME:
 PyMVPA Environment Variables:
  PYTHONPATH          :
":/home/shim/.python27_compiled:/usr/lib/python2.7/plat-linux2:/usr/bin:/usr/lib/python2.7/dist-packages/ubuntuone-couch:/data/projects/09dec11er:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/IPython/extensions:/usr/lib/python2.7:/usr/lib/python2.7/dist-packages/PIL:/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-dynload:/usr/lib/python2.7/dist-packages/ubuntu-sso-client:/usr/lib/python2.7/dist-packages/ubuntuone-client:/usr/lib/python2.7/dist-packages/ubuntuone-installer:/usr/lib/python2.7/lib-old:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/python2.7/dist-packages/ubuntuone-control-panel:/usr/lib/pymodules/python2.7:/usr/lib/python2.7/dist-packages/gst-0.10"
 PyMVPA Runtime Configuration:
  [general]
  verbose = 1

  [externals]
  have running ipython env = yes
  have numpy = yes
  have scipy = yes
  have matplotlib = yes
  have h5py = yes
  have reportlab = yes
  have weave = yes
  have good scipy.stats.rdist = yes
  have good scipy.stats.rv_discrete.ppf = yes
  have pylab = yes
  have lars = no
  have elasticnet = no
  have glmnet = no
  have skl = yes
  have ctypes = yes
  have libsvm = yes
  have shogun = yes
  have sg ge 0.6.5 = yes
  have shogun.mpd = yes
  have shogun.lightsvm = no
  have shogun.svrlight = no
  have shogun.krr = yes
  have shogun.svmocas = yes
  have sg_fixedcachesize = yes
  have openopt = no
  have nibabel = yes
  have mdp = yes
  have mdp ge 2.4 = yes
  have statsmodels = no
  have pywt = yes
  have cpickle = yes
  have gzip = yes
  have cran-energy = no
  have griddata = yes
  have nipy.neurospin = no
  have lxml = yes
  have atlas_fsl = no
  have atlas_pymvpa = no
  have hcluster = no
  have ipython = yes
  have liblapack.so = yes
  have libsvm verbosity control = yes
  have mass = no
  have nipy = no
  have nose = yes
  have pprocess = no
  have pylab plottable = yes
  have pywt wp reconstruct = yes
  have pywt wp reconstruct fixed = no
  have rpy2 = no
  have sg ge 0.6.4 = yes
 Process Information:
  Name:    python
  State:    R (running)
  Tgid:    3346
  Pid:    3346
  PPid:    2453
  TracerPid:    0
  Uid:    1000    1000    1000    1000
  Gid:    1000    1000    1000    1000
  FDSize:    256
  Groups:    4 24 27 30 46 109 124 1000
  VmPeak:      875080 kB
  VmSize:      793920 kB
  VmLck:           0 kB
  VmPin:           0 kB
  VmHWM:      249916 kB
  VmRSS:      145868 kB
  VmData:      274428 kB
  VmStk:         264 kB
  VmExe:        2500 kB
  VmLib:       85992 kB
  VmPTE:        1240 kB
  VmSwap:           0 kB
  Threads:    3
  SigQ:    0/127910
  SigPnd:    0000000000000000
  ShdPnd:    0000000000000000
  SigBlk:    0000000000000000
  SigIgn:    0000000001001000
  SigCgt:    0000000180000002
  CapInh:    0000000000000000
  CapPrm:    0000000000000000
  CapEff:    0000000000000000
  CapBnd:    ffffffffffffffff
  Cpus_allowed:    ff
  Cpus_allowed_list:    0-7
  Mems_allowed:    00000000,00000001
  Mems_allowed_list:    0
  voluntary_ctxt_switches:    627
  nonvoluntary_ctxt_switches:    1414
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20120907/e97a0ea8/attachment-0001.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list