Tensorflow.strided_slice missing argument 'strides'?

I try to run cifar10_train.py according to the 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 states that strides is optional, and it worked correctly on Ubuntu before.

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

Can I pass this argument? I have no idea about this ...

UPDATE: I replaced strided_slice with a slice, and it works. According to release # 754, strides will be optional in version 1.0. (May be?)

+5
source share
2 answers

Replace string

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

to line:

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

and line in the following statement

 [label_bytes + image_bytes]), 

in line

 [label_bytes + image_bytes], [1]), 

This works for me.

+6
source

@ user3143469 already gave the desired answer.

Turning to TF 0.12, there are a few things in the cifar10 tutorial that need to be updated (see porting request ).

See https://github.com/MartinThoma/algorithms/commit/38ce1f87d6e4396cde64fe831c2ead2507781270 for the changes you need to make, and this folder to use the code + instructions for using it.

+5
source

Source: https://habr.com/ru/post/1261420/


All Articles