From 446bdadab8d1f32b357d54bb0cdec4f340dd185a Mon Sep 17 00:00:00 2001 From: Solange Emmenegger <solange.emmenegger@hslu.ch> Date: Sun, 18 Sep 2022 10:20:10 +0000 Subject: [PATCH] Looked at demos --- ...feature_engineering_image_similarity.ipynb | 17 +++---- .../feature_engineering.ipynb | 6 +-- .../Generative Adversarial Network.ipynb | 25 ++++++++-- demos/Generative Models/PokeGAN.ipynb | 6 +-- .../german_sentiment_analysis.ipynb | 47 +++++-------------- 5 files changed, 45 insertions(+), 56 deletions(-) diff --git a/demos/Convolutional Neural Networks/feature_engineering_image_similarity.ipynb b/demos/Convolutional Neural Networks/feature_engineering_image_similarity.ipynb index c7da1b0..092fec4 100644 --- a/demos/Convolutional Neural Networks/feature_engineering_image_similarity.ipynb +++ b/demos/Convolutional Neural Networks/feature_engineering_image_similarity.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -25,7 +25,7 @@ "\n", "# Run pip install --upgrade tensorflow_hub if necessary\n", "import tensorflow as tf\n", - "import tensorflow_hub as hub\n", + "#import tensorflow_hub as hub\n", "\n", "from sklearn.neighbors import NearestNeighbors\n", "\n", @@ -33,10 +33,7 @@ "from tqdm.auto import tqdm\n", "\n", "# Interactive elements for Jupyter notebooks\n", - "from ipywidgets import interact\n", - "\n", - "# Make sure you have the right tensorflow version installed\n", - "assert tf.__version__ == '2.3.1'" + "from ipywidgets import interact\n" ] }, { @@ -276,9 +273,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [], "source": [ "image = train_images[100]\n", @@ -444,7 +439,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -458,7 +453,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.9.12" } }, "nbformat": 4, diff --git a/demos/Feature Engineering/feature_engineering.ipynb b/demos/Feature Engineering/feature_engineering.ipynb index 5868e2c..862b770 100644 --- a/demos/Feature Engineering/feature_engineering.ipynb +++ b/demos/Feature Engineering/feature_engineering.ipynb @@ -88,7 +88,7 @@ "import sklearn.linear_model\n", "import sklearn.model_selection\n", "import sklearn.metrics\n", - "import yfinance as yf\n", + "#import yfinance as yf\n", "\n", "from skimage import io\n", "from skimage import data as skimage_data\n", @@ -2284,7 +2284,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -2298,7 +2298,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.9.12" } }, "nbformat": 4, diff --git a/demos/Generative Models/Generative Adversarial Network.ipynb b/demos/Generative Models/Generative Adversarial Network.ipynb index d89d2eb..6d2bf8e 100644 --- a/demos/Generative Models/Generative Adversarial Network.ipynb +++ b/demos/Generative Models/Generative Adversarial Network.ipynb @@ -14,11 +14,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "id": "2k7AAMRMCveU" }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-09-18 10:12:53.186873: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA\n", + "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", + "2022-09-18 10:12:53.377166: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory\n", + "2022-09-18 10:12:53.377211: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.\n", + "2022-09-18 10:12:53.418637: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n", + "2022-09-18 10:12:54.314211: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory\n", + "2022-09-18 10:12:54.314335: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory\n", + "2022-09-18 10:12:54.314347: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.\n" + ] + } + ], "source": [ "# import packages\n", "import os\n", @@ -813,7 +828,7 @@ "toc_visible": true }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -827,7 +842,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.9.12" }, "toc": { "base_numbering": 1, @@ -844,5 +859,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/demos/Generative Models/PokeGAN.ipynb b/demos/Generative Models/PokeGAN.ipynb index 4d419af..5d08c0f 100644 --- a/demos/Generative Models/PokeGAN.ipynb +++ b/demos/Generative Models/PokeGAN.ipynb @@ -388,7 +388,7 @@ "toc_visible": true }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -402,7 +402,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.9.12" }, "toc": { "base_numbering": 1, @@ -419,5 +419,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/demos/German Sentiment Analysis/german_sentiment_analysis.ipynb b/demos/German Sentiment Analysis/german_sentiment_analysis.ipynb index 674c4f2..6f16773 100644 --- a/demos/German Sentiment Analysis/german_sentiment_analysis.ipynb +++ b/demos/German Sentiment Analysis/german_sentiment_analysis.ipynb @@ -103,13 +103,7 @@ " compilation terminated.\n", " error: command '/usr/bin/gcc' failed with exit code 1\n", " ----------------------------------------\u001b[0m\n", - "\u001b[31m ERROR: Failed building wheel for editdistance\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "\u001b[31m ERROR: Failed building wheel for editdistance\u001b[0m\n", "\u001b[31m ERROR: Command errored out with exit status 1:\n", " command: /opt/conda/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-3hsqkcrs/editdistance_1dae79594cd84b7c8bc3f5b91e2a2615/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-3hsqkcrs/editdistance_1dae79594cd84b7c8bc3f5b91e2a2615/setup.py'\"'\"';f = getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__) if os.path.exists(__file__) else io.StringIO('\"'\"'from setuptools import setup; setup()'\"'\"');code = f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' install --record /tmp/pip-record-zyco0pi_/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.9/editdistance\n", " cwd: /tmp/pip-install-3hsqkcrs/editdistance_1dae79594cd84b7c8bc3f5b91e2a2615/\n", @@ -173,13 +167,7 @@ "Requirement already satisfied: protobuf<3.18.0,>=3.12.0 in /opt/conda/lib/python3.9/site-packages (from google-api-core<2dev,>=1.21.0->google-api-python-client==1.12.8) (3.17.3)\n", "Requirement already satisfied: packaging>=14.3 in /opt/conda/lib/python3.9/site-packages (from google-api-core<2dev,>=1.21.0->google-api-python-client==1.12.8) (21.0)\n", "Requirement already satisfied: setuptools>=40.3.0 in /opt/conda/lib/python3.9/site-packages (from google-api-core<2dev,>=1.21.0->google-api-python-client==1.12.8) (58.0.4)\n", - "Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /opt/conda/lib/python3.9/site-packages (from google-api-core<2dev,>=1.21.0->google-api-python-client==1.12.8) (2.26.0)\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /opt/conda/lib/python3.9/site-packages (from google-api-core<2dev,>=1.21.0->google-api-python-client==1.12.8) (2.26.0)\n", "Requirement already satisfied: pytz in /opt/conda/lib/python3.9/site-packages (from google-api-core<2dev,>=1.21.0->google-api-python-client==1.12.8) (2021.1)\n", "Requirement already satisfied: rsa<5,>=3.1.4 in /opt/conda/lib/python3.9/site-packages (from google-auth>=1.16.0->google-api-python-client==1.12.8) (4.7.2)\n", "Requirement already satisfied: cachetools<5.0,>=2.0.0 in /opt/conda/lib/python3.9/site-packages (from google-auth>=1.16.0->google-api-python-client==1.12.8) (4.2.2)\n", @@ -210,28 +198,19 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { - "name": "stderr", - "output_type": "stream", - "text": [ - "[nltk_data] Downloading package stopwords to /home/jovyan/nltk_data...\n", - "[nltk_data] Package stopwords is already up-to-date!\n", - "[nltk_data] Downloading package punkt to /home/jovyan/nltk_data...\n", - "[nltk_data] Package punkt is already up-to-date!\n" + "ename": "ModuleNotFoundError", + "evalue": "No module named 'somajo'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "Input \u001b[0;32mIn [1]\u001b[0m, in \u001b[0;36m<cell line: 3>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpandas\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mpd\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msomajo\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m SoMaJo\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtime_tracker\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m measure_time\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mwarnings\u001b[39;00m\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'somajo'" ] - }, - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -1391,9 +1370,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.9.12" } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } -- GitLab