Skip to content
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

2 bugs in training/input.py #480

Closed
oliverfunk opened this issue Dec 11, 2015 · 4 comments
Closed

2 bugs in training/input.py #480

oliverfunk opened this issue Dec 11, 2015 · 4 comments
Assignees

Comments

@oliverfunk
Copy link

In the _dtype() method in the training/input.py file, the following code for TypeError:

  raise TypeError("Expected types to be consistent: %s vs. %s." %
                  ", ".join(x.name for x in types),
                  ", ".join(x.name for x in other_types))

should be:

  raise TypeError("Expected types to be consistent: %s vs. %s." %
                  (", ".join(x.name for x in types),
                  ", ".join(x.name for x in other_types)))

Also, when using the tf.train.shuffle_batch_join() method, you are suppose to pass a list of tuples of tensors, but if you pass a list of tuple and each tuple only contains one item, python will ignore the tuples and simply make it into a list. Thus, when the _flatten method in training/inputs.py is called, a TypeError: 'Tensor' object is not iterable is thrown. I suppose it's not necessarily a bug as one should know if you want to pass a tuple containing just one item, you must put a comma at the end of the tuple, but it may still may cause confusion.

Instead, _flatten could be:

def _flatten(tensor_list_list):
        for elm in tensor_list_list:
            if not isinstance(elm, tuple):
                raise TypeError("tensor_list_list must contain tuples.")
        return [tensor for tensor_list in tensor_list_list for tensor in tensor_list]
@oliverfunk oliverfunk changed the title Small bug in training/input.py _dtype method TypeError message 2 bugs in training/input.py Dec 11, 2015
vrv pushed a commit that referenced this issue Dec 23, 2015
@vrv
Copy link

vrv commented Dec 23, 2015

I have a fix out for the first issue: feel free to send us a PR for the second one!

@girving
Copy link
Contributor

girving commented Mar 8, 2016

@vrv: If the actual bug is fixed, should we close this? I don't think it's a TensorFlow bug that (1) isn't a tuple in Python.

@vrv
Copy link

vrv commented Mar 8, 2016

I think it's fixed.

@vrv vrv closed this as completed Mar 8, 2016
@chayitw
Copy link

chayitw commented Nov 28, 2016

I just met the same issue (2) but about using tf.train.batch_join() of the TF' version(0.11.0rc1). As oliverfunk said, i put a comma at the end of the tuple and seems work.

Thanks!

My code is like as below:

example_list = [
( img_preprocess.read_my_file_format(
filename_queue,
reader = tf.WholeFileReader(),
decoder= img_preprocess.my_file_decoder_png,
shape = shape,
isWithLabel= False ), ) for _ in range(read_threads) ];

darkbuck pushed a commit to darkbuck/tensorflow that referenced this issue Jan 23, 2020
…pstream-deven-misc-190530

renaming dnn_pooling_gpu.[h,cc] back to cudnn_pooling_gpu.[h,cc]  and other changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants