- Environment
- Ubuntu 18.04 LTS
- Driver Version 495.29.05
- CUDA 11.3
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[40]: | |
import pandas as pd | |
import os, glob | |
import sys |
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
sns.set() | |
def stacked_bar(data, series_labels, category_labels=None, | |
show_values=False, value_format="{}", y_label=None, | |
grid=True, reverse=False): | |
"""Plots a stacked bar chart with the data and labels provided. |
import pandas as pd | |
import os, glob | |
import sys | |
# full or absolute path to the folder with txt files | |
full_path_mo = '/home/nechk/NECHK-Results/cnmo/mo/' | |
full_path_cn = '/home/nechk/NECHK-Results/cnmo/cn/' | |
# path for saving files | |
save_path = '/home/nechk/NECHK-Results/cnmo/image2/' |
import numpy as np | |
import matplotlib.pyplot as plt | |
from collections import Counter | |
import pandas as pd | |
import os, glob | |
import sys | |
import seaborn as sns | |
sns.set() | |
#%matplotlib inline |
import pandas as pd | |
import os, glob | |
import sys | |
# full or absolute path to the folder with txt files | |
full_path = '/path/to/txt/files/' | |
# path for saving files | |
save_path = '/path/for/saving/txt/files/' | |
# getting the current directory |
import pandas as pd | |
import os, glob | |
import sys | |
# full or absolute path to the folder with txt files | |
full_path = '/path/to/txt/files/' | |
# path for saving files | |
save_path = '/path/for/saving/txt/files/' | |
# getting the current directory |
import cv2 | |
import time | |
CONFIDENCE_THRESHOLD = 0.2 | |
NMS_THRESHOLD = 0.4 | |
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, 0), (255, 0, 0)] | |
class_names = [] | |
with open("classes.txt", "r") as f: | |
class_names = [cname.strip() for cname in f.readlines()] |
@url https://major.io/2007/07/05/bintar-argument-list-too-long/ | |
If you find yourself stuck with over 30,000 files in a directory (text files in this example), packing them into a tar file can be tricky. You can get around it with this: | |
find . -name '*.txt' -print >/tmp/test.manifest | |
tar -cvzf textfiles.tar.gz --files-from /tmp/test.manifest | |
find . -name '*.txt' | xargs rm -v |
As Tensorflow is continuously evolving, it is normal to find a situation in which you require multiple versions of Tensorflow to coexist on the same machine. Those versions can be different enough to have different CUDA library dependencies. In this case, you can be tempted to upgrade to the latest release but maybe some of your solutions are still in production or just there are not more holes in your calendar.
In this gist I will cover how to install several CUDA libraries to support different tensorflow verions. However, there are some red lines that you have to respect as the GCC versions, that must be the same, and the nvidia drivers that must support the target CUDA versions. You can check that information in the Tensoroflow website.
The basic idea is to install the CUDA libraries and abuse of the linux system to find the correct libraries when executing the target tensorflow version