所以我正在训练Tensorflow中的NN,同时我正在监视我的GPU负载。
从屏幕截图中可以看到Tensorflow基本上只使用GPU内存,这正常吗?我以为他们利用了我所有的cuda核心来执行一些计算等。
有没有人真的知道这些东西?
提前致谢!
代码来了...
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.INFO)
# ... some file reading here
def train_input_fn(features, labels, batch_size):
return tf.estimator.inputs.pandas_input_fn(
x = features,
y = labels,
num_epochs = 1,
shuffle = True,
batch_size = batch_size)
def eval_input_fn(features, labels):
return tf.estimator.inputs.pandas_input_fn(
x = features,
y = labels,
num_epochs = 1,
shuffle = True)
def pred_input_fn(features):
return tf.estimator.inputs.pandas_input_fn(
x = features,
num_epochs = 1,
shuffle = False)
model_dir = './DNN_Linear_Combined_Regressor'
file_writer = tf.summary.FileWriter(model_dir)
estimator = tf.estimator.DNNLinearCombinedRegressor(
model_dir = model_dir,
linear_feature_columns = wide_columns,
dnn_feature_columns = deep_columns,
dnn_optimizer = tf.train.AdamOptimizer(learning_rate=0.001),
dnn_hidden_units = [64,64,64,8],
batch_norm = True,
dnn_dropout = 0.1
)
train_spec = tf.estimator.TrainSpec(input_fn = train_input_fn(train, y_train, batch_size=5000))
eval_spec = tf.estimator.EvalSpec(input_fn = eval_input_fn(valid, y_valid))
tf.estimator.train_and_evaluate(estimator, train_spec, eval_spec)
慕桂英546537
相关分类