Lasagne / Recipes

Lasagne recipes: examples, IPython notebooks, ...
MIT License
914 stars 419 forks source link

modelzoo resnet50.py incompatible to Python 3 #105

Closed maxi1192 closed 7 years ago

maxi1192 commented 7 years ago

Hi, when I try to build the network the following error is reported: Traceback (most recent call last): File "resnet.py", line 233, in network = build_model() File "resnet.py", line 165, in build_model sub_net, parent_layer_name = build_residual_block(net[parent_layer_name], 1, 1, True, 4, ix='2%s' % c) File "resnet.py", line 121, in build_residual_block int(lasagne.layers.get_output_shape(incoming_layer)[1]*ratio_n_filter), 1, int(1.0/ratio_size), 0) File "resnet.py", line 62, in build_simple_block names[0], TypeError: 'map' object is not subscriptable

I did not change anything in the code you uploaded, what is wrong?

maxi1192 commented 7 years ago

It can be solved by casting the map() functions to lists in build_residual_block()

f0k commented 7 years ago

Ah, seems it was written for Python 2. Thanks for the report! We'd welcome a fix :) Casting as lists, or rewriting to use list comprehensions would both be acceptable. Would you like to send a PR? In any case, I'm reopening (and retiteling) this so we don't forget.

maxi1192 commented 7 years ago

PR sent