lmjohns3 / theanets

Neural network toolkit for Python
http://theanets.rtfd.org
MIT License
328 stars 74 forks source link

TypeError #49

Closed davegreenwood closed 9 years ago

davegreenwood commented 9 years ago

Hi, Using dev version of theano-nets, pulled today, I get the following TypeError:

Traceback (most recent call last):
  File "/Users/davegreenwood/Desktop/ttest.py", line 3, in <module>
    e = theanets.Classifier(layers = [5,5,5])
  File "/Users/davegreenwood/_git/theano-nets/theanets/feedforward.py", line 775, in __init__
    super(Classifier, self).__init__(**kwargs)
TypeError: must be type, not classobj
[Finished in 0.7s with exit code 1]

Using the simplest code example:

import theanets
e = theanets.Classifier(layers=[5, 5, 5])

changing class Network: to class Network(object):makes the error go away, but I'm sure this is not the intended solution.

My OS and Python version:

Python 2.7.8 |Anaconda 2.1.0 (x86_64)| (default, Aug 21 2014, 15:21:46) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> 

Many thanks Dave.

davegreenwood commented 9 years ago

I'd just like to add that if I pip install theanets everything works fine.

lmjohns3 commented 9 years ago

Ok, thanks for the report! I did remove object as a parent class of Network but apparently this breaks the super() method in py2.