import tensorflow

import tensorflow.keras as keras

x = keras.layers.Dense(10)

x

import pandas

# Choose your own data file, in CSV format.
# Pandas can also read Microsoft Excel (XLSX) format using `pandas.read_excel`
df = pandas.read_csv("sherlock_apps_yhe_test.csv")

df.describe()

"""
Explanation: Hands-on Demo on Wahab Open OnDemand / Jupyter Notebook
Date: 2020-08-04
Useful documentations:

Python container, how to install your own package: https://wiki.hpc.odu.edu/Software/Python
TensorFlow container, https://wiki.hpc.odu.edu/Software/Tensorflow
OnDemand interface: https://wiki.hpc.odu.edu/open-ondemand
Launching & using JupyterLab from OnDemand (still work in progress): https://wiki.hpc.odu.edu/ood-jupyter

For help, please mail itshelp@odu.edu, mark it for attention of Research Computing.
About this notebook
This dummy notebook was to be launched with one of the TensorFlow containers on Wahab's OnDemand interface: https://ondemand.wahab.hpc.odu.edu/ . Click "Interactive Apps" on the top menu bar, then choose "Jupyter".
If you do not have any specific version in mine, choose Python Suite named "tensorflow 2.0 + pytorch 1.3 CPU"
Hands-on Demo
End of explanation
"""


# Where am I running?
!hostname

# How much memory is left on this compute node?
!free

# On GPU node, you can check the status of the GPU using `nvidia-smi` command:
!nvidia-smi

"""
Explanation: Standard UNIX programs can also be run from Jupyter by prepending it with "!".
They better be non-interactive program, not asking for input or output. For example:
End of explanation
"""


import PIL

PIL.__version__

PIL

"""
Explanation: Try to load another library? See if the TensorFlow container has it...
End of explanation
"""


import os
import sys

sys.path.append(os.environ["HOME"] + "/envs/image_procs/lib/python3.7/site-packages")

import cv2

cv2.__version__

"""
Explanation: Need extra Python modules?
You can add user module environment to which then you can install extra modules.
To create the environment for the first time: follow instructions in https://wiki.hpc.odu.edu/Software/Python#install-additional-python-modules . Use image_procs for PROJECT_NAME, for example. Suppose you need "cv2" package. Here are the steps to do it (adapt to your specific need)
This need to be done on Wahab's shell interface. Issue the following commands: (remember to pick the right TensorFlow container if it is not tensorflow 2.0 on CPU)
~~~
module load container_env tensorflow-cpu/2.0.0
crun.tensorflow-cpu -c -p ~/envs/image_procs
crun.tensorflow-cpu -p ~/envs/image_procs pip install opencv-python
~~~
End of explanation
"""


