tensorflow / tensorflow/models

auto-deeplab: nas_network runs into ValueError with personal data

Open
#7,453 2 comments 0 reactions 3 assignees View on GitHub

@aquariusjay is already working on this.

Since Jun 24, 2020.

models:research type:support
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

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

  • What is the top-level directory of the model you are using: /tensorflow/models/research/
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Tried on both ubuntu 18.04 and windows 10
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): 1.13.1
  • Python version: 3.7.3
  • Bazel version (if compiling from source): N/A
  • CUDA/cuDNN version: 10.1/ 7.6
  • GPU model and memory: Nvidia Geforce GTX 1080TI 11GB on ubuntu, CPU on windows
  • Exact command to reproduce: python deeplab/core/nas_newtork.py

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].

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.