mxochicale / intro-to-transformers

0 stars 0 forks source link

:rocket: Timeseries classification with a Transformer model using codespace #2

Open mxochicale opened 1 year ago

mxochicale commented 1 year ago
mxochicale commented 1 year ago

I am re-opening this one as I feel tutorials need some further lines to get better understanding of data shapes and few other bits for the ML/AL workflow.

mxochicale commented 1 year ago

after running in codespaces

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
import matplotlib.pyplot as plt
import itertools
import sklearn.metrics

\/

2023-08-03 22:12:07.443262: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-08-03 22:12:08.081107: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-08-03 22:12:08.082403: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 22:12:12.307588: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
mxochicale commented 1 year ago

with Installs shared libraries for NVIDIA CUDA. in devcontainer https://github.com/devcontainers/features/tree/main/src/nvidia-cuda

"features": {
    "ghcr.io/devcontainers/features/nvidia-cuda:1": {}
}

got this

2023-08-06 10:54:03.324966: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-06 10:54:05.399619: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
mxochicale commented 1 year ago

Examples of other containers https://github.com/tanmayeekamath/Simple-Image-Classifier/blob/main/.devcontainer.json https://github.com/tanmayeekamath/stable-diffusion/blob/main/.devcontainer/devcontainer.json https://www.youtube.com/watch?v=RIchFX_gYb0 https://github.com/Openscapes/codespace-testing https://github.com/Openscapes/codespace-testing/blob/main/.devcontainer/devcontainer.json

hints to setup your docker https://stackoverflow.com/questions/59289917/how-to-use-a-yaml-file-with-dockerfile-to-activate-conda-environment

https://github.com/mamba-org/devcontainer-features/tree/main/src/micromamba


{
    "name": "micromamba",
    "build": { 
        "context": "..",
        "dockerfile": "Dockerfile"
    },
    "features": {
        "ghcr.io/devcontainers/features/nvidia-cuda:1": {},
        "ghcr.io/mamba-org/devcontainer-features/micromamba:1": {
            "channels": "conda-forge",
            "packages": "python>=3.11",
                "envFile": "/tmp/specfile.yml"
          } 
       }
}
mxochicale commented 1 year ago
Running cells with 'base' requires the ipykernel package.
Run the following command to install 'ipykernel' into the Python environment. 
Command: 'conda install -n base ipykernel --update-deps --force-reinstall'
mxochicale commented 1 year ago

Examples