CIHP_PGN icon indicating copy to clipboard operation
CIHP_PGN copied to clipboard

TypeError: unsupported operand type(s) for /: 'Dimension' and 'int'

Open ahwhbc opened this issue 6 years ago • 5 comments

I run the code test_pgn.py ,but I come across this problem TypeError: unsupported operand type(s) for /: 'Dimension' and 'int'

ahwhbc avatar Jul 12 '19 13:07 ahwhbc

I get the same issue. I change shape=[k_h, k_w, c_i / group, c_o] to shape=[k_h, k_w, int(c_i) / group, c_o] and it work fine for me.

leo19980219 avatar Jul 25 '19 07:07 leo19980219

True. Or, you can use .as_list() for example c_i = input.get_shape().as_list()[-1] for the c_i

finde avatar Sep 03 '19 17:09 finde

@leo19980219 @finde I make changes as you said and it resolved this issue but now it throw another error.

File "test_pgn.py", line 112, in main for xx in xrange(14): NameError: name 'xrange' is not defined

MuhammadAsadJaved avatar Dec 05 '19 06:12 MuhammadAsadJaved

I have resolved this issue. It's because python version difference. xrange() is function in python 2.x which can be replaced with range() if you are using python 3.x. so just replace xrange() with range().

MuhammadAsadJaved avatar Dec 05 '19 06:12 MuhammadAsadJaved

I run the code test_pgn.py ,but I come across this problem TypeError: unsupported operand type(s) for /: 'Dimension' and 'int'

replace / to //

dveersingh avatar Dec 24 '19 18:12 dveersingh