Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Manager
372 Views

mvNCCompile Error: [Error 5] Toolkit Error: Stage Details Not Supported: ZerosLike

Here is the model that was used:

 

def make_model(X, y, unit_nums): """ Makes a 4-hidden-layer DNN with the number of hidden units as given in unit_nums. Uses ReLU activations and Xavier initialization. Outputs a single scalar with sigmoid activation. Returns the output tensor, the cost, and the accuracy. """ assert len(unit_nums) == 4 seed = 20180908 dense_1 = tf.layers.dense(X, unit_nums[0], activation=tf.nn.relu, kernel_initializer=tf.contrib.layers.xavier_initializer(seed=seed) ) dense_2 = tf.layers.dense(dense_1, unit_nums[1], activation=tf.nn.relu, kernel_initializer=tf.contrib.layers.xavier_initializer(seed=seed) ) dense_3 = tf.layers.dense(dense_2, unit_nums[2], activation=tf.nn.relu, kernel_initializer=tf.contrib.layers.xavier_initializer(seed=seed) ) dense_4 = tf.layers.dense(dense_3, unit_nums[3], activation=tf.nn.relu, kernel_initializer=tf.contrib.layers.xavier_initializer(seed=seed) ) logits = tf.layers.dense(dense_4, 1, activation=None, kernel_initializer=tf.contrib.layers.xavier_initializer(seed=seed) ) cost = tf.nn.sigmoid_cross_entropy_with_logits(labels=y, logits=logits) cost = tf.reduce_mean(cost) output = tf.sigmoid(logits, name="dnn_output") correct = tf.equal(tf.round(output), y) accuracy = tf.reduce_mean(tf.cast(correct, tf.float32)) return output, cost, accuracy

 

Here is the training:

 

sess = tf.Session() X_place = tf.placeholder(tf.float64, shape=(None, 1802), name="dnn_input") y_place = tf.placeholder(tf.float64, shape=(None, 1)) unit_nums = [1802, 901, 450, 225] pred, cost, acc = make_model(X_place, y_place, unit_nums) opt = tf.train.AdagradOptimizer(learning_rate=0.1).minimize(cost) init = tf.global_variables_initializer() sess.run(init) model_name = args.model if "/" in args.model or not args.model else "./" + args.model saver = tf.train.Saver(tf.global_variables())

 

Thanks for your time!

0 Kudos
0 Replies