mrkwjc / ffnet

Feed-forward neural network for python
GNU Lesser General Public License v3.0
12 stars 7 forks source link

ffnet throwing TypeError #3

Open pisaac-ozflux opened 6 years ago

pisaac-ozflux commented 6 years ago

Hi mrkwjc, Many thanks for all your work on FFNET over the years. I ran into a problem with FFNET today. The exception is below: TypeError: object of type 'dictionary-keyiterator' has no len() and is thrown at line 611 of ffnet.py: n = len(self.graph.predecessors(trg)) The fix I used was to change line 611 of ffnet.py to: n = len(list(self.graph.predecessors(trg))) Other details are: OS: Ubuntu 14.04 Python: Anaconda 2.7 (I can supply a list of installed packages and version numbers if required) Cheers, Peter

mrkwjc commented 6 years ago

Dnia poniedziałek, 22 stycznia 2018 06:54:34 CET Peter Isaac pisze:

I ran into a problem with FFNET today. The exception is below: TypeError: object of type 'dictionary-keyiterator' has no len() and is thrown at line 611 of ffnet.py: n = len(self.graph.predecessors(trg)) The fix I used was to change line 611 of ffnet.py to: n = len(list(self.graph.predecessors(trg)))

Tanks for reporting. This problem arises when networkx-2.x is installed. I'll fix it soon...

pisaac-ozflux commented 6 years ago

Yeah, I caught the networkx >= 2 link but figured that a simple hack was better than reverting to an earlier version.

Thanks, Peter

On 22 January 2018 at 20:15, Marek Wojciechowski notifications@github.com wrote:

Dnia poniedziałek, 22 stycznia 2018 06:54:34 CET Peter Isaac pisze:

I ran into a problem with FFNET today. The exception is below: TypeError: object of type 'dictionary-keyiterator' has no len() and is thrown at line 611 of ffnet.py: n = len(self.graph.predecessors(trg)) The fix I used was to change line 611 of ffnet.py to: n = len(list(self.graph.predecessors(trg)))

Tanks for reporting. This problem arises when networkx-2.x is installed. I'll fix it soon...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mrkwjc/ffnet/issues/3#issuecomment-359364771, or mute the thread https://github.com/notifications/unsubscribe-auth/AGckibNWyhe7QqpA66qxODks1S13OPxGks5tNFGjgaJpZM4RmMol .

-- Peter Isaac Ph: +61 3 59685998 Mob: 0429053970 Skype: pisaac.ozflux Email: pisaac.ozflux@gmail.com