小编use*_*184的帖子

选择GeForce或Quadro GPU,通过TensorFlow进行机器学习

如果使用Quadro GPU与GeForce GPU,TensorFlow性能是否有明显差异?

例如,它是否使用双精度操作或其他会导致GeForce卡掉落的东西?

我即将为TensorFlow购买GPU,并想知道GeForce是否可以.谢谢,感谢您的帮助

gpu gpgpu machine-learning tensorflow

31
推荐指数
1
解决办法
4万
查看次数

使用预定义估算器的tf.train.exponential_decay?

我试图将tf.train.exponential_decay与预定义的估算器一起使用,由于某种原因,这被证明是超级难的.我在这里错过了什么吗?

这是我的旧代码,具有不断的learning_rate:

classifier = tf.estimator.DNNRegressor(
    feature_columns=f_columns,
    model_dir='./TF',
    hidden_units=[2, 2],
    optimizer=tf.train.ProximalAdagradOptimizer(
      learning_rate=0.50,
      l1_regularization_strength=0.001,
    ))
Run Code Online (Sandbox Code Playgroud)

现在我尝试添加这个:

starter_learning_rate = 0.50
global_step = tf.Variable(0, trainable=False)
learning_rate = tf.train.exponential_decay(starter_learning_rate, global_step,
                                           10000, 0.96, staircase=True)
Run Code Online (Sandbox Code Playgroud)

但现在呢?

  • estimator.predict()不接受global_step所以它会被卡在0?
  • 即使我将learning_rate传递给tf.train.ProximalAdagradOptimizer(),我也会收到错误消息

"ValueError:Tensor("ExponentialDecay:0",shape =(),dtype = float32)必须与Tensor相同的图形("dnn/hiddenlayer_0/kernel/part_0:0",shape =(62,2),dtype = float32_ref)".

非常感谢您的帮助.我正在使用TF1.6顺便说一句.

tensorflow tensorflow-estimator

6
推荐指数
1
解决办法
315
查看次数

我可以阻止int typedef隐式转换为int吗?

我想以下不能编译.

typedef int relative_index_t;  // Define an int to only use for indexing.
void function1(relative_index_t i) {
  // Do stuff.
}

relative_index_t y = 1; function1(y);  // I want this to build.
int x = 1; function1(x);               // I want this to NOT build!
Run Code Online (Sandbox Code Playgroud)

有没有办法实现这个目标?

c++ casting

2
推荐指数
1
解决办法
578
查看次数