This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import tensorflow as tf | |
import numpy as np | |
from tensorflow import keras | |
print(tf.__version__) | |
print(tf.keras.__version__) | |
inputs = [] | |
inputs.append(keras.Input(shape=(1,), name='x_float', dtype='float32')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#FROM nvidia/cuda:9.0-devel-ubuntu16.04 | |
FROM ubuntu:16.04 | |
# TensorFlow version is tightly coupled to CUDA and cuDNN so it should be selected carefully | |
ENV TENSORFLOW_VERSION=1.12.0 | |
ENV PYTORCH_VERSION=1.0.0 | |
# Python 2.7 or 3.5 is supported by Ubuntu Xenial out of the box | |
ARG python=3.5 | |
ENV PYTHON_VERSION=${python} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import horovod.tensorflow as hvd | |
import tensorflow as tf | |
import time | |
config = tf.ConfigProto() | |
tf.enable_eager_execution(config=config) | |
hvd.init() | |
with tf.device("/cpu:0"): | |
tf.set_random_seed(1234) |