tensorflow-gpu-1.13 and after require TF_FORCE_GPU_ALLOW_GROWTH work around tensorflow/tensorflow#24496
Keras-2.2.5
tensorflow-gpu-1.12.0
libcudnn7 7.6.5.32-1+cuda10.0
cuda-libraries-10-0
# A script to group delivery areas into routes of roughly similar size. | |
import csv | |
from sklearn import cluster | |
from pyproj import Proj, transform | |
import numpy as np | |
from matplotlib import pyplot as plt | |
class EqualWeightClustering(object): |
# https://askubuntu.com/a/1337205/294281 | |
import os | |
import stat | |
import glob | |
from pathlib import Path | |
import shutil | |
if __name__=="__main__": | |
ver = "495.29.05" |
#pyellipse by Tim Sheerman-Chase (C) 2021 | |
#Calculate circumference of an ellipse in python (both exact and approximate approaches) | |
#This source code may be used under the CC0 license https://creativecommons.org/publicdomain/zero/1.0/ | |
# | |
#For the best exact circumference, use EllipseCircumAdlaj2012 | |
# | |
#For good approximations that are faster to compute, see EllipseCircumRamanujan2ndApprox and EllipseCircumJacobsenWaadeland1985 | |
# | |
#Incidentally, scipy has a function to exactly calculate it: | |
# C = 4.0*a*special.ellipe(e*e) |
#Using Keras to tackle the Inria aerial image labeling dataset | |
# https://project.inria.fr/aerialimagelabeling/ | |
import os | |
#Work around for https://github.com/tensorflow/tensorflow/issues/24496 | |
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' | |
# Work around for https://github.com/tensorflow/tensorflow/issues/33024 | |
import tensorflow.compat as compat | |
compat.v1.disable_eager_execution() |
import os | |
#Work around for https://github.com/tensorflow/tensorflow/issues/24496 | |
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' | |
# Work around for https://github.com/tensorflow/tensorflow/issues/33024 | |
import tensorflow.compat as compat | |
compat.v1.disable_eager_execution() | |
import imageio | |
from sklearn.model_selection import KFold, train_test_split |
#Based on https://machinelearningmastery.com/how-to-develop-a-convolutional-neural-network-from-scratch-for-mnist-handwritten-digit-classification/ | |
import os | |
#Work around for https://github.com/tensorflow/tensorflow/issues/24496 | |
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' | |
# baseline cnn model for mnist | |
from numpy import mean | |
from numpy import std | |
from matplotlib import pyplot |
import os | |
#Work around for https://github.com/tensorflow/tensorflow/issues/24496 | |
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' | |
# Work around for https://github.com/tensorflow/tensorflow/issues/33024 | |
import tensorflow.compat as compat | |
compat.v1.disable_eager_execution() | |
# baseline cnn model for mnist | |
import numpy as np |
tensorflow-gpu-1.13 and after require TF_FORCE_GPU_ALLOW_GROWTH work around tensorflow/tensorflow#24496
Keras-2.2.5
tensorflow-gpu-1.12.0
libcudnn7 7.6.5.32-1+cuda10.0
cuda-libraries-10-0
Site ID | X | Y | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | |
---|---|---|---|---|---|---|---|---|---|---|
1 | 463872 | 99874 | 42.54 | 41.9 | 42.57 | 44.33 | 43.52 | 38.8 | 42.92 | |
2 | 463705 | 99371 | 17.48 | 16.5 | 16.55 | 15.74 | 17.4 | 16.38 | 17.09 | |
3 | 463408 | 99460 | 26.63 | 22.1 | 25.67 | 24.07 | 25.75 | 23.7 | 24.13 | |
4 | 463190 | 100390 | 36.35 | 31.51 | 27.97 | 30.54 | 34.7 | 34.2 | 34.04 | |
5 | 464230 | 102194 | 28.62 | 27.49 | 28.93 | 27.53 | 29.52 | 24.48 | 28.08 | |
6 | 464331 | 102197 | 35.62 | 38.29 | 34.85 | 46.06 | 36.08 | 32.08 | 30.86 | |
7 | 464291 | 102279 | 29.78 | 30 | 26.53 | 26.05 | 28.09 | 27.32 | 27.74 | |
8 | 466690 | 104355 | 28.81 | 27.22 | 28.37 | 28.43 | 29.94 | 26.75 | 25.97 | |
9 | 465621 | 105528 | 35.07 | 31.95 | 33.88 | 34.98 | 40.86 | 37.06 | 36.7 |
from __future__ import unicode_literals | |
from __future__ import print_function | |
def SplitQuoted(inStr, delim=','): | |
if '"' in delim or '\\' in delim: | |
raise ValueError("Delimiter not supported") | |
l = len(inStr) |