Skip to content

Instantly share code, notes, and snippets.

View tpu_reduced_thread.py
session_config = tf.ConfigProto(
intra_op_parallelism_threads=64,
inter_op_parallelism_threads=4,
)
...
run_config = tpu.RunConfig(
session_config=session_config,
@rjpower
rjpower / test.py
Last active Dec 12, 2018
disable grappler
View test.py
from tensorflow.core.protobuf import rewriter_config_pb2
config = tf.ConfigProto()
config.graph_options.rewrite_options.memory_optimization = (
rewriter_config_pb2.RewriterConfig.NO_MEM_OPT)
off = rewriter_config_pb2.RewriterConfig.OFF
config.graph_options.rewrite_options.layout_optimizer = off
config.graph_options.rewrite_options.constant_folding = off
config.graph_options.rewrite_options.arithmetic_optimization = off
config.graph_options.rewrite_options.dependency_optimization = off
config.graph_options.rewrite_options.loop_optimization = off
View reset-tpus.py
import tensorflow as tf
import sys
from tensorflow.contrib.tpu.python.tpu import session_support
def reset_tpu(name):
print('Resetting: %s' % name)
resolver = tf.contrib.cluster_resolver.TPUClusterResolver(tpu=name, job_name='worker')
address = resolver.master()
cluster_def = resolver.cluster_spec().as_cluster_def()
View imagenet-to-gcs-parallel.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@rjpower
rjpower / imagenet-to-gcs-validation-only.py
Last active Mar 19, 2018
imagenet-to-gcs-validation-only.py
View imagenet-to-gcs-validation-only.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
View wikipedia-parsing-example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View keras-multi-output.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View keybase.md

Keybase proof

I hereby claim:

  • I am rjpower on github.
  • I am rjpower (https://keybase.io/rjpower) on keybase.
  • I have a public key whose fingerprint is 02B7 A69B 419C 88AA 7894 5643 1E8B D393 6F4A 624E

To claim this, I am signing this object:

View highlights.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.