sionna icon indicating copy to clipboard operation
sionna copied to clipboard

Part 4: Toward Learned Receivers Bug TensorShape to a Tensor: (None, None)

Open BramvBk opened this issue 3 years ago • 6 comments

When trying the Part 4: Toward Learned Receivers example at the step Training the Neural Receiver I get an error about TensorShape to a Tensor: (None, None) while i did not alter the example in any way. why is this? The full error is bellow:

Traceback (most recent call last): File "/cm/local/apps/slurm/var/spool/job6555120/slurm_script", line 308, in loss = model(BATCH_SIZE, ebno_db) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 885, in call result = self._call(*args, **kwds) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 933, in _call self._initialize(args, kwds, add_initializers_to=initializers) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 760, in _initialize *args, **kwds)) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 3066, in _get_concrete_function_internal_garbage_collected graph_function, _ = self._maybe_define_function(args, kwargs) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 3463, in _maybe_define_function graph_function = self._create_graph_function(args, kwargs) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 3308, in _create_graph_function capture_by_value=self._capture_by_value), File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/framework/func_graph.py", line 1007, in func_graph_from_py_func func_outputs = python_func(*func_args, **func_kwargs) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 668, in wrapped_fn out = weak_wrapped_fn().wrapped(*args, **kwds) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 3990, in bound_method_wrapper return wrapped_fn(*args, **kwargs) File "/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/framework/func_graph.py", line 994, in wrapper raise e.ag_error_metadata.to_exception(e) ValueError: in user code:

/cm/local/apps/slurm/var/spool/job6555120/slurm_script:280 __call__  *
    llr = self.rg_demapper(llr) # Extract data-carrying resource elements. The other LLrs are discarded
/home/tue/20184223/.local/lib/python3.6/site-packages/sionna/ofdm/resource_grid.py:470 call  *
    y = flatten_dims(y, 2, 2)
/home/tue/20184223/.local/lib/python3.6/site-packages/sionna/utils/tensors.py:76 flatten_dims  *
    flat_dim = tf.reduce_prod(tensor.shape[axis:axis+num_dims])
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/util/dispatch.py:206 wrapper  **
    return target(*args, **kwargs)
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py:2744 reduce_prod
    input_tensor, _ReductionDims(input_tensor, axis), keepdims,
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py:2094 _ReductionDims
    return range(0, array_ops.rank(x))
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/util/dispatch.py:206 wrapper
    return target(*args, **kwargs)
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py:839 rank
    return rank_internal(input, name, optimize=True)
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py:859 rank_internal
    input = ops.convert_to_tensor(input)
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/profiler/trace.py:163 wrapped
    return func(*args, **kwargs)
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py:1566 convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
/home/tue/20184223/.local/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py:363 _tensor_shape_tensor_conversion_function
    "Cannot convert a partially known TensorShape to a Tensor: %s" % s)

ValueError: Cannot convert a partially known TensorShape to a Tensor: (None, None)

BramvBk avatar Jun 21 '22 14:06 BramvBk

Could you please let us know details of your system, such as TF, Sionna, and Python versions? Which OS are you using?

jhoydis avatar Jun 21 '22 15:06 jhoydis

I have used in on a windows machine it has python 3.10.4 sionna 0.9.1 and tensorflow 2.9.1 i have also tried it on a different machine running linux with python 3.6.8 siona 0.9.1 and tensorflow 2.6.2

Both of them show the exact same error.

BramvBk avatar Jun 21 '22 15:06 BramvBk

Sionna does currently not support TF 2.9.1. Can you downgrade to TF 2.8 on your windows machine?

jhoydis avatar Jun 21 '22 15:06 jhoydis

Just tried this i got the same error

BramvBk avatar Jun 21 '22 15:06 BramvBk

Ok. We'll look into it. I cannot reproduce the error on my system and the notebook executes without error on Google Colab.

jhoydis avatar Jun 21 '22 15:06 jhoydis

Thanks, for the help

BramvBk avatar Jun 21 '22 15:06 BramvBk

We were not able to reproduce the error and close this issue. Please re-open in case that the problem persists.

jhoydis avatar Sep 13 '22 11:09 jhoydis