You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i run “d_grads = d_opt.compute_gradients(self.d_losses[-1],
var_list=self.d_vars)” in model.py
it occurs this problem “ AttributeError: 'dict_values' object has no attribute 'op' ”
How to solve this problem?
Best regards!
The text was updated successfully, but these errors were encountered:
def get_vars(self):
t_vars = tf.trainable_variables()
self.d_vars_dict = {}
self.g_vars_dict = {}
for var in t_vars:
if var.name.startswith('d_'):
self.d_vars_dict[var.name] = var
if var.name.startswith('g_'):
self.g_vars_dict[var.name] = var
self.d_vars = self.d_vars_dict.values()
self.g_vars = self.g_vars_dict.values()
change to this:
def get_vars(self):
t_vars = tf.trainable_variables()
self.d_vars = [var for var in t_vars if 'd_' in var.name]
self.g_vars = [var for var in t_vars if 'g_' in var.name]
When i run “d_grads = d_opt.compute_gradients(self.d_losses[-1],
var_list=self.d_vars)” in model.py
it occurs this problem “ AttributeError: 'dict_values' object has no attribute 'op' ”
How to solve this problem?
Best regards!
The text was updated successfully, but these errors were encountered: