diff --git a/examples/5G_Channel_Coding_Polar_vs_LDPC_Codes.ipynb b/examples/5G_Channel_Coding_Polar_vs_LDPC_Codes.ipynb index c3c85ed..ef78c13 100644 --- a/examples/5G_Channel_Coding_Polar_vs_LDPC_Codes.ipynb +++ b/examples/5G_Channel_Coding_Polar_vs_LDPC_Codes.ipynb @@ -74,18 +74,6 @@ " os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", - "import tensorflow as tf\n", - "# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n", - "# For more details, see https://www.tensorflow.org/guide/gpu\n", - "gpus = tf.config.list_physical_devices('GPU')\n", - "if gpus:\n", - " try:\n", - " tf.config.experimental.set_memory_growth(gpus[0], True)\n", - " except RuntimeError as e:\n", - " print(e)\n", - "# Avoid warnings from TensorFlow\n", - "tf.get_logger().setLevel('ERROR')\n", - "\n", "# Import Sionna\n", "try:\n", " import sionna\n", diff --git a/examples/5G_NR_PUSCH.ipynb b/examples/5G_NR_PUSCH.ipynb index d78f5ce..c6f4132 100644 --- a/examples/5G_NR_PUSCH.ipynb +++ b/examples/5G_NR_PUSCH.ipynb @@ -60,18 +60,6 @@ " os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", - "import tensorflow as tf\n", - "# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n", - "# For more details, see https://www.tensorflow.org/guide/gpu\n", - "gpus = tf.config.list_physical_devices('GPU')\n", - "if gpus:\n", - " try:\n", - " tf.config.experimental.set_memory_growth(gpus[0], True)\n", - " except RuntimeError as e:\n", - " print(e)\n", - "# Avoid warnings from TensorFlow\n", - "tf.get_logger().setLevel('ERROR')\n", - "\n", "# Import Sionna\n", "try:\n", " import sionna\n", diff --git a/examples/Evolution_of_FEC.ipynb b/examples/Evolution_of_FEC.ipynb index 83855a9..cbb6a8f 100644 --- a/examples/Evolution_of_FEC.ipynb +++ b/examples/Evolution_of_FEC.ipynb @@ -50,19 +50,6 @@ " os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", - "# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n", - "# For more details, see https://www.tensorflow.org/guide/gpu\n", - "import tensorflow as tf\n", - "gpus = tf.config.list_physical_devices('GPU')\n", - "if gpus:\n", - " try:\n", - " tf.config.experimental.set_memory_growth(gpus[0], True)\n", - " except RuntimeError as e:\n", - " print(e)\n", - "\n", - "# Avoid warnings from TensorFlow\n", - "tf.get_logger().setLevel('ERROR')\n", - "\n", "# Import Sionna\n", "try:\n", " import sionna\n", diff --git a/examples/Introduction_to_Iterative_Detection_and_Decoding.ipynb b/examples/Introduction_to_Iterative_Detection_and_Decoding.ipynb index 9a237de..fa08ec5 100644 --- a/examples/Introduction_to_Iterative_Detection_and_Decoding.ipynb +++ b/examples/Introduction_to_Iterative_Detection_and_Decoding.ipynb @@ -96,17 +96,6 @@ " os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", - "import tensorflow as tf\n", - "from tensorflow.keras import Model\n", - "gpus = tf.config.list_physical_devices('GPU')\n", - "if gpus:\n", - " try:\n", - " tf.config.experimental.set_memory_growth(gpus[0], True)\n", - " except RuntimeError as e:\n", - " print(e)\n", - "# Avoid warnings from TensorFlow\n", - "tf.get_logger().setLevel('ERROR')\n", - "\n", "# Import Sionna\n", "try:\n", " import sionna\n", diff --git a/examples/MIMO_OFDM_Transmissions_over_CDL.ipynb b/examples/MIMO_OFDM_Transmissions_over_CDL.ipynb index 41b427a..97f9d04 100644 --- a/examples/MIMO_OFDM_Transmissions_over_CDL.ipynb +++ b/examples/MIMO_OFDM_Transmissions_over_CDL.ipynb @@ -105,6 +105,15 @@ " os.environ[\"CUDA_VISIBLE_DEVICES\"] = f\"{gpu_num}\"\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", + "# Import Sionna\n", + "try:\n", + " import sionna\n", + "except ImportError as e:\n", + " # Install Sionna if package is not already installed\n", + " import os\n", + " os.system(\"pip install sionna\")\n", + " import sionna\n", + "\n", "# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n", "# For more details, see https://www.tensorflow.org/guide/gpu\n", "import tensorflow as tf\n", diff --git a/examples/Sionna_tutorial_part1.ipynb b/examples/Sionna_tutorial_part1.ipynb index bad147d..4f3be37 100644 --- a/examples/Sionna_tutorial_part1.ipynb +++ b/examples/Sionna_tutorial_part1.ipynb @@ -72,19 +72,6 @@ "\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", - "# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n", - "# For more details, see https://www.tensorflow.org/guide/gpu\n", - "import tensorflow as tf\n", - "gpus = tf.config.list_physical_devices('GPU')\n", - "if gpus:\n", - " try:\n", - " tf.config.experimental.set_memory_growth(gpus[0], True)\n", - " except RuntimeError as e:\n", - " print(e) \n", - "\n", - "# Avoid warnings from TensorFlow\n", - "tf.get_logger().setLevel('ERROR')\n", - "\n", "# Import Sionna\n", "try:\n", " import sionna as sn\n", diff --git a/examples/Sionna_tutorial_part2.ipynb b/examples/Sionna_tutorial_part2.ipynb index 73c69c0..d1d016d 100644 --- a/examples/Sionna_tutorial_part2.ipynb +++ b/examples/Sionna_tutorial_part2.ipynb @@ -68,19 +68,6 @@ "\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", - "# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n", - "# For more details, see https://www.tensorflow.org/guide/gpu\n", - "import tensorflow as tf\n", - "gpus = tf.config.list_physical_devices('GPU')\n", - "if gpus:\n", - " try:\n", - " tf.config.experimental.set_memory_growth(gpus[0], True)\n", - " except RuntimeError as e:\n", - " print(e) \n", - "\n", - "# Avoid warnings from TensorFlow\n", - "tf.get_logger().setLevel('ERROR')\n", - "\n", "# Import Sionna\n", "try:\n", " import sionna as sn\n", diff --git a/examples/Sionna_tutorial_part3.ipynb b/examples/Sionna_tutorial_part3.ipynb index dda99f7..2f2c4ee 100644 --- a/examples/Sionna_tutorial_part3.ipynb +++ b/examples/Sionna_tutorial_part3.ipynb @@ -69,19 +69,6 @@ "\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", - "# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n", - "# For more details, see https://www.tensorflow.org/guide/gpu\n", - "import tensorflow as tf\n", - "gpus = tf.config.list_physical_devices('GPU')\n", - "if gpus:\n", - " try:\n", - " tf.config.experimental.set_memory_growth(gpus[0], True)\n", - " except RuntimeError as e:\n", - " print(e) \n", - "\n", - "# Avoid warnings from TensorFlow\n", - "tf.get_logger().setLevel('ERROR')\n", - "\n", "# Import Sionna\n", "try:\n", " import sionna as sn\n", diff --git a/examples/Sionna_tutorial_part4.ipynb b/examples/Sionna_tutorial_part4.ipynb index 3945d16..64ae148 100644 --- a/examples/Sionna_tutorial_part4.ipynb +++ b/examples/Sionna_tutorial_part4.ipynb @@ -77,19 +77,6 @@ "\n", "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n", "\n", - "# Configure the notebook to use only a single GPU and allocate only as much memory as needed\n", - "# For more details, see https://www.tensorflow.org/guide/gpu\n", - "import tensorflow as tf\n", - "gpus = tf.config.list_physical_devices('GPU')\n", - "if gpus:\n", - " try:\n", - " tf.config.experimental.set_memory_growth(gpus[0], True)\n", - " except RuntimeError as e:\n", - " print(e) \n", - "\n", - "# Avoid warnings from TensorFlow\n", - "tf.get_logger().setLevel('ERROR')\n", - "\n", "# Import Sionna\n", "try:\n", " import sionna as sn\n",