Skip to content

Instantly share code, notes, and snippets.

View mcotton's full-sized avatar

Mark Cotton mcotton

View GitHub Profile
@mcotton
mcotton / Install_Tensforflow2_with_GPU_in_Ubuntu20.04.md
Created May 24, 2023 14:23 — forked from raulqf/Install_Tensforflow2_with_GPU_in_Ubuntu20.04.md
How to install Tensorflow2 with GPU support in Ubuntu 20.04

How to install Tensorflow2 with GPU support in Ubuntu 20.04

Installation of Tensorflow2 with GPU support is easy and the only complication can be arisen from the CUDA compability which in turns depends on the Nvidia driver version. Before going farther, please check if your Nvidia Video Card is compatible with the required versions that are defined in this gist, use this link.

Tensorflow offers in its website a table of the compatibility between libraries for the target OS. You can visit that website in the following COMPATIBILITY TABLE that points to the Tensorflow installation from source for linux. For the time writing this gist, Tensorflow2 v2.5.0 requires CUDA v11.2 and CUDNN v8.2. It is really important to match the exact version, otherwise tensorflow will have problems loading the shared libraries as not finding the correct version.

CUDA version also requires for a minimum Nvidia driver version

@mcotton
mcotton / gist:ed7fde33fc5dcd2620ebac624a1ff4ec
Last active March 19, 2023 02:18
Making use of tensorflow GPU on PopOS 22.04

from the host system

tensorman run -p 8888:8888 --gpu --python3 --jupyter bash

from inside tensorman

jupyter notebook --ip=0.0.0.0 --no-browser

back on host system

open http://127.0.0.1:8888/?token=18d08c03e8ffd3bcc18fab37f6a4dc4cd146120979d62ed8

someone suggest running this instead of dealing with jupyter token

@mcotton
mcotton / gist:3ce8c8cab98805b04b4ca16c819b8b15
Created November 19, 2020 03:51
fix for smb shares disconnecting on Big Sur
https://www.reddit.com/r/MacOSBeta/comments/im0unc/smb_in_big_sur_beta_6/g3zevaf/
HI, these 2 commands in the terminal have fixed my SMB problem with the beta 6:
Open Terminal and type:
sudo sh -c 'echo "[default]\nsigning_required=no" > /etc/nsmb.conf'
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Quit terminal
sudo du -a /home/mcotton/ | sort -n -r | head -n 20
@mcotton
mcotton / gist:b9b9bdacbab613c654a6bc9b87018424
Last active February 7, 2020 13:50
fix for Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
#
# Look at https://www.tensorflow.org/guide/gpu for an explaination
# Here are the two options they presented
#
# Option 1
# set_memory_growth before creatingt the CONV network
import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices('GPU')
ffplay -flags2 +export_mvs video.mp4 -vf codecview=mv=pf+bf+bb
#.bashrc
alias disableGUI='sudo systemctl set-default multi-user.target'
alias enableGUI='sudo systemctl set-default graphical.target'
alias startGUI='sudo systemctl start gdm3.service'
alias stopGUI='sudo systemctl stop gdm3.service'
/usr/bin/setxkbmap -option "caps:escape"
if [ -f ~/dev/personal/dot_files/.docker_aliases ]; then
@mcotton
mcotton / remote.py
Last active August 29, 2018 18:28
Moving Media/Checklists from H1 -> H2
def export_dict(self):
return {
"H1_id": self.key.id(),
"gcs_filename": self.gcs_filename,
"serving_url": self.serving_url,
"file_name": self.file_name,
"created_at": str(self.created_at),
"company": self.company.id(),
"project": self.project.id(),
"mime_type": self.mime_type,
@mcotton
mcotton / crapy.py
Created December 19, 2017 15:02
Attaching items uploaded to GCS to media objects
execfile('remote.py')
set_current_namespace('mcotton')
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
import cloudstorage as gcs
blob_key = blobstore.create_gs_key('/gs/' + s.GCS_BUCKET + '/152_592.zip')
billy = blobstore.BlobKey(blob_key)
@mcotton
mcotton / morph.sh
Created October 30, 2017 14:26
Morph between two images
convert DSC_5936.JPG DSC_5937.JPG DSC_5936.JPG -loop 0 -morph 18 -gravity South -resize 600x400 -rotate 270 morph.gif