tensorflow / models

Models and examples built with TensorFlow
Other
77.02k stars 45.78k forks source link

auto-deeplab: nas_network runs into ValueError with personal data #7453

Open lrizzello opened 5 years ago

lrizzello commented 5 years ago

Hello,

I've been trying to use auto deeplab on my own dataset. The only part I touched is the stem creation. Instead of feeding a image set of dimension [?, y, x, 3] I feed data of dimension [?, y, x, 13]. The first 10 features of the last dimension correspond to character embeddings, and the last 3 are unrelated floats in the [0, 1] range. There are no NANs in this dataset.

To do this, I replace the beginning of the _nas_net function in nas_network.py. I get an array with shape [?, y, x, 4] as input, the first feature is a char ID to be replaced by a 10 dimensional embedding, the 3 other features stay as they are. This leads to a [?, y, x, 13] tensor which is then used by the rest of the code.

As my input seems sensible enough, I believe this may be a bug with the implementation. Could someone investigate this further, please?

System information

Describe the current behavior program crashes with error pasted at the bottom of this issue

Describe the expected behavior auto deeplab keeps going as expected

Code to reproduce the issue replace the content of /tensorflow/models/research/deeplab/core/nas_network.py by this code and run nas_network.py directly from the /tensorflow/research/ workspace. The only modification I brought to this file, besides the new main part at the bottom to run a simple fail case, can be found in the _nas_stem function.

Other info / logs

Traceback (most recent call last):
  File "C:/Users/lrizzello/source/repos/Company/Company.Python/deeplab/core/nas_network.py", line 308, in <module>
    hnasnet(all_features, pipeline_parameters, n_classes)
  File "C:/Users/lrizzello/source/repos/Company/Company.Python/deeplab/core/nas_network.py", line 294, in hnasnet
    final_endpoint=final_endpoint)
  File "C:/Users/lrizzello/source/repos/Company/Company.Python/deeplab/core/nas_network.py", line 183, in _build_nas_base
    cell_num=cell_num)
  File "C:\Users\lrizzello\source\repos\Company\Company.Python\deeplab\core\nas_cell.py", line 82, in __call__
    h = h1 + h2
  File "C:\Users\lrizzello\AppData\Local\Continuum\anaconda3\envs\py37\lib\site-packages\tensorflow\python\ops\math_ops.py", line 812, in binary_op_wrapper
    return func(x, y, name=name)
  File "C:\Users\lrizzello\AppData\Local\Continuum\anaconda3\envs\py37\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 374, in add
    "Add", x=x, y=y, name=name)
  File "C:\Users\lrizzello\AppData\Local\Continuum\anaconda3\envs\py37\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
    op_def=op_def)
  File "C:\Users\lrizzello\AppData\Local\Continuum\anaconda3\envs\py37\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "C:\Users\lrizzello\AppData\Local\Continuum\anaconda3\envs\py37\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op
    op_def=op_def)
  File "C:\Users\lrizzello\AppData\Local\Continuum\anaconda3\envs\py37\lib\site-packages\tensorflow\python\framework\ops.py", line 1823, in __init__
    control_input_ops)
  File "C:\Users\lrizzello\AppData\Local\Continuum\anaconda3\envs\py37\lib\site-packages\tensorflow\python\framework\ops.py", line 1662, in _create_c_op
    raise ValueError(str(e))
ValueError: Dimensions must be equal, but are 14 and 13 for 'hnasnet/cell_5/comb_iter_0/combine/add' (op: 'Add') with input shapes: [?,14,25,40], [?,13,25,40].
tensorflowbutler commented 5 years ago

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using Bazel version Exact command to reproduce

lrizzello commented 5 years ago

I updated my original post.