Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow.strided_slice missing argument 'strides'?

I am trying to run cifar10_train.py according to tutorials, but I got

"cifar10_input.py", line 87, in read_cifar10
tf.strided_slice(record_bytes, [0], [label_bytes]), tf.int32)
TypeError: strided_slice() missing 1 required positional argument: 'strides'

The document says that strides is optional, and it did work properly on Ubuntu before.

My tensorflow version is 0.12.0rc1-cp35-cp35m-win_amd64. I have already installed the newest release.

May I have to pass this argument? I have no idea about it...

UPDATE: I replaced strided_slice with slice, and it works. According to issue#754, strides will be optional at 1.0 release. (maybe?)

like image 692
Joshua Astray Avatar asked Dec 17 '16 03:12

Joshua Astray


2 Answers

Replace a line

tf.strided_slice(record_bytes, [0], [label_bytes]), tf.int32)

to the line:

tf.strided_slice(record_bytes, [0], [label_bytes], [1]), tf.int32)

and a line in the next operator

[label_bytes + image_bytes]),

to the line

[label_bytes + image_bytes], [1]),

It works for me.

like image 66
eluk Avatar answered Sep 28 '22 19:09

eluk


@user3143469 already gave the desired answer.

Going to TF 0.12, there are several things in the cifar10 tutorial which need to be updated (see pull request).

See https://github.com/MartinThoma/algorithms/commit/38ce1f87d6e4396cde64fe831c2ead2507781270 for the changes which need to be made and this folder for working code + instructions how to use it.

like image 23
Martin Thoma Avatar answered Sep 28 '22 19:09

Martin Thoma