vat_tf icon indicating copy to clipboard operation
vat_tf copied to clipboard

usage of 'range' in 'reduce_max' and 'reduce_sum' needs to be debugged

Open roomo7time opened this issue 6 years ago • 3 comments

https://github.com/takerum/vat_tf/blob/c5125d267531ce0f10b2238cf95604d287de63c8/vat.py#L34

In tensorflow (1.8>) with python 3, this line does not seem to work. It seems range needs to be wrapped by 'list'.

roomo7time avatar Sep 06 '18 10:09 roomo7time

vat_tf/vat.py

Line 34 in c5125d2

d /= (1e-12 + tf.reduce_max(tf.abs(d), range(1, len(d.get_shape())), keep_dims=True)) In tensorflow (1.8>) with python 3, this line does not seem to work. It seems range needs to be wrapped by 'list'.

did you fix the bug?

marcosly avatar Nov 13 '18 12:11 marcosly

Dictionary operations should be fixed as well:

https://github.com/takerum/vat_tf/blob/c5125d267531ce0f10b2238cf95604d287de63c8/train_semisup.py#L180

iteritems() should be changed to items(). Also values() in the lines below should be wrapped in list() as well.

seansaito avatar Mar 04 '19 08:03 seansaito

I used [i for i in range(1, len(d.get_shape())] to replace it and worked well

SiyuWang15 avatar Apr 01 '19 02:04 SiyuWang15