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
| 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) | 
| //By Tim Sheerman-Chase, released under CC0 | |
| //Compile: g++ shapelib_example.cpp -lshp -o shapelib_example | |
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include "shapefil.h" | |
| using namespace std; | |
| int main(int argc, const char **argv) | 
| from pyo5m import OsmData | |
| import requests | |
| if __name__=="__main__": | |
| # | |
| osc = OsmData.OsmChange() | |
| osc.LoadFromOscXml(open("bad_changeset.osc", "rb")) | |
| refNodes, refWays, refRelations = set(), set(), set() | 
| #Download osc diffs using custom pycrocosm api method | |
| #Released under CC0 license | |
| import requests | |
| import datetime | |
| import os | |
| import gzip | |
| def DownloadDiffs(epoch = datetime.date(2016, 9, 27), | |
| dt=datetime.timedelta(1), | 
| import os | |
| import requests | |
| if __name__=="__main__": | |
| interval = "day" | |
| pth = "/home/tim/replicatefsm" | |
| #Check what already exists | |
| fiList = os.listdir(pth) | 
| import numpy as np | |
| def EqualizeHistogram(a, bins): | |
| a = np.array(a) | |
| hist, bins2 = np.histogram(a, bins=bins) | |
| #Compute CDF from histogram | |
| cdf = np.cumsum(hist, dtype=np.float64) | |
| cdf = np.hstack(([0], cdf)) | |
| cdf = cdf / cdf[-1] | 
| import csv | |
| # Filtering file https://data.gov.uk/dataset/7ec10db7-c8f4-4a40-8d82-8921935b4865/national-statistics-postcode-lookup-uk | |
| if __name__=="__main__": | |
| reader = csv.DictReader(open("/home/tim/Downloads/National_Statistics_Postcode_Lookup_UK.csv")) | |
| out = csv.DictWriter(open("natstats-po-postcodes.csv", "wt"), reader.fieldnames) | |
| out.writeheader() |