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

AttributeError: module 'sionna' has no attribute 'config' #468

Open
MizWong opened this issue Jun 10, 2024 · 9 comments
Open

AttributeError: module 'sionna' has no attribute 'config' #468

MizWong opened this issue Jun 10, 2024 · 9 comments

Comments

@MizWong
Copy link

MizWong commented Jun 10, 2024

Hi,

When I run Simple_MIMO_Simulation, this error occurred, the sionna version is the latest released one by PIP.

@SebastianCa
Copy link
Collaborator

Hi @MizWong,

I am unable to reproduce the error with my setup, and it also works fine in Colab.

It seems to be an issue with your local installation. Could you please provide more details about your system setup?

@vishalgoyal316
Copy link

I am also facing same issue with my setup.

@SebastianCa
Copy link
Collaborator

Hi @vishalgoyal316,

could you please provide more details about your system setup?

@IhabAdarbeh
Copy link

IhabAdarbeh commented Jun 13, 2024

Hallo,
I also get the same error":(AttributeError: Exception encountered when calling layer 'lmmse_equalizer' (type LMMSEEqualizer).).module 'sionna' has no attribute 'config'" when I try to execute this section:

//simulation parameters
ebno_db = 10
batch_size = 200
// and call the model
b, b_hat = model(batch_size, ebno_db)
ber = sionna.utils.metrics.compute_ber(b, b_hat)
nb_bits = np.size(b.numpy())
print("BER: {:.4} at Eb/No of {} dB and {} simulated bits".format(ber.numpy(), ebno_db, nb_bits))

I am using Anaconda as the development environment, Jupyter Notebook as the compiler, and Python 3.8 with TensorFlow 2.14 und Sionna 0.18.0 version.

@SebastianCa
Copy link
Collaborator

Hi @IhabAdarbeh,

It seems like there might be an issue with your local Sionna installation. Here are a few things you can try to troubleshoot:

  • Could you please run other notebooks to see if the issue is specific to the Simple MIMO notebook and the lmmse_equalizer?
  • Try importing Sionna in an empty notebook (or Python environment) and print the version:
import sionna as sn
print(sn.__version__)
  • The tutorial notebooks are designed to automatically install Sionna if it’s not found (to ensure compatibility with Google Colab). This could potentially interfere with your Anaconda virtual environment. For more details, you can refer to issue #471.

@sycskr
Copy link

sycskr commented Jun 29, 2024

Hello,i also meet this issue. Same problem as in question #123 : I was attempting to run the Sionna Tutorial on "Part 3: Advanced Link-Level Simulations" when I encountered this error in the LMMSE Equalizer. The notebook was taken directly from the site. The Sionna version I am using is 0.18.0. But reinstalling the environment as in #123 didn't solve the problem.

File [~\AppData\Local\Programs\Python\Python310\lib\site-packages\sionna\utils\tensors.py:242](http://localhost:8890/lab/tree/discover%20sionna/~/AppData/Local/Programs/Python/Python310/lib/site-packages/sionna/utils/tensors.py#line=241), in matrix_sqrt_inv(tensor)
    216 def matrix_sqrt_inv(tensor):
    217     r""" Computes the inverse square root of a Hermitian matrix.
    218 
    219     Given a batch of Hermitian positive definite matrices
   (...)
    240         See :py:attr:`~sionna.Config.xla_compat`.
    241     """
--> 242     if sn.config.xla_compat and not tf.executing_eagerly():
    243         s, u = tf.linalg.eigh(tensor)
    245         # Compute 1/sqrt of eigenvalues

AttributeError: Exception encountered when calling layer 'lmmse_equalizer_2' (type LMMSEEqualizer).

module 'sionna' has no attribute 'config'

Call arguments received by layer 'lmmse_equalizer_2' (type LMMSEEqualizer):
  • inputs=['tf.Tensor(shape=(200, 1, 1, 14, 256), dtype=complex64)', 'tf.Tensor(shape=(200, 1, 1, 1, 1, 14, 256), dtype=complex64)', 'tf.Tensor(shape=(1, 1, 1, 1, 1, 14, 256), dtype=float32)', 'tf.Tensor(shape=(), dtype=float32)']

I tried the sample given in question #123 and got the same error result

import sionna
import tensorflow as tf
from sionna.utils import matrix_sqrt_inv
matrix_sqrt_inv(tf.eye(5))
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[34], line 9
      7 import tensorflow as tf
      8 from sionna.utils import matrix_sqrt_inv
----> 9 matrix_sqrt_inv(tf.eye(5))

File [~\AppData\Local\Programs\Python\Python310\lib\site-packages\sionna\utils\tensors.py:242](http://localhost:8890/lab/tree/discover%20sionna/~/AppData/Local/Programs/Python/Python310/lib/site-packages/sionna/utils/tensors.py#line=241), in matrix_sqrt_inv(tensor)
    216 def matrix_sqrt_inv(tensor):
    217     r""" Computes the inverse square root of a Hermitian matrix.
    218 
    219     Given a batch of Hermitian positive definite matrices
   (...)
    240         See :py:attr:`~sionna.Config.xla_compat`.
    241     """
--> 242     if sn.config.xla_compat and not tf.executing_eagerly():
    243         s, u = tf.linalg.eigh(tensor)
    245         # Compute 1/sqrt of eigenvalues

AttributeError: module 'sionna' has no attribute 'config'

@jhoydis
Copy link
Collaborator

jhoydis commented Oct 2, 2024

Could you try this again with the latest release 0.19?

@zylinzzz
Copy link

Same issue here with release 0.19.1:

line 231, in training_loop sn.Config.xla_compat = xla AttributeError: module 'sionna' has no attribute 'Config'. Did you mean: 'config'?

@merlinND
Copy link
Collaborator

merlinND commented Jan 3, 2025

Hello @zylinzzz,

The previous messages in this thread reported the error: AttributeError: module 'sionna' has no attribute 'config'

However you pasted: AttributeError: module 'sionna' has no attribute 'Config'. Did you mean: 'config'?
Maybe you simply wrote sn.Config instead of sn.config?

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

8 participants