-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: unsupported operand type(s) for /: 'Dimension' and 'int' #83
Comments
I had the same problem. You will need to do a bunch of small tweaks to make it work in Python 3.6. In that particular case what happens is that get_shape() in a couple of places of kaffe/tensorflow/network.py returns a dimension. To get the shape as a list of ints, do tensor.get_shape().as_list() |
Thanks, @cbessega I will check it on 2.7. |
type casting the Dimension to int will solve the problem: if you have a=10, dim = X.shape[10], then instead of adim use aint(dim) |
For newbies (like me) and as mentioned in #80 |
sz = input.shape |
FYI I had exactly the same error when running the Transformer tutorial and I managed to resolve it by adding |
Am using tensorflow 1.0 and python 3.6. can you check it ?
Traceback (most recent call last):
File "train.py", line 253, in
main()
File "train.py", line 144, in main
net = DeepLabResNetModel({'data': image_batch}, is_training=args.is_training, num_classes=args.num_classes)
File "/home/batuser/Documents/color/kaffe/tensorflow/network.py", line 48, in init
self.setup(is_training, num_classes)
File "/home/batuser/Documents/color/deeplab_resnet/model.py", line 114, in setup
.atrous_conv(3, 3, 256, 2, padding='SAME', biased=False, relu=False, name='res4a_branch2b')
File "/home/batuser/Documents/color/kaffe/tensorflow/network.py", line 22, in layer_decorated
layer_output = op(self, layer_input, *args, **kwargs)
File "/home/batuser/Documents/color/kaffe/tensorflow/network.py", line 170, in atrous_conv
kernel = self.make_var('weights', shape=[k_h, k_w, c_i / group, c_o])
TypeError: unsupported operand type(s) for /: 'Dimension' and 'int'
The text was updated successfully, but these errors were encountered: