彑氷 2021-07-06 19:36 采纳率: 83.3%
浏览 69
已结题

tensorflow2.0报错

ValueError Traceback (most recent call last)
in
155 if name == 'main':
156 train = Train()
--> 157 train.train()

in train(self)
24
25 tf.set_random_seed(cfg.FLAGS.rng_seed)
---> 26 layers = self.net.create_architecture(sess, "TRAIN", self.imdb.num_classes, tag='default')
27 loss = layers['total_loss']
28 lr = tf.Variable(cfg.FLAGS.learning_rate, trainable=False)

E:\Faster-RCNN-TensorFlow-Python3-master\lib\nets\network.py in create_architecture(self, sess, mode, num_classes, tag, anchor_scales, anchor_ratios)
295 biases_regularizer=biases_regularizer,
296 biases_initializer=tf.constant_initializer(0.0)):
--> 297 rois, cls_prob, bbox_pred = self.build_network(sess, training)
298
299 layers_to_output = {'rois': rois}

E:\Faster-RCNN-TensorFlow-Python3-master\lib\nets\vgg16.py in build_network(self, sess, is_training)
28
29 # Build head
---> 30 net = self.build_head(is_training)
31
32 # Build rpn

E:\Faster-RCNN-TensorFlow-Python3-master\lib\nets\vgg16.py in build_head(self, is_training)
95 # Main network
96 # Layer 1
---> 97 net = slim.repeat(self._image, 2, slim.conv2d, 64, [3, 3], trainable=False, scope='conv1')
98 net = slim.max_pool2d(net, [2, 2], padding='SAME', scope='pool1')
99

E:\Anconada\lib\site-packages\tf_slim\layers\layers.py in repeat(inputs, repetitions, layer, *args, **kwargs)
2646 for i in range(repetitions):
2647 kwargs['scope'] = scope + '_' + str(i + 1)
-> 2648 outputs = layer(outputs, *args, **kwargs)
2649 return outputs
2650

E:\Anconada\lib\site-packages\tf_slim\ops\arg_scope.py in func_with_args(*args, **kwargs)
182 current_args = current_scope[key_func].copy()
183 current_args.update(kwargs)
--> 184 return func(*args, **current_args)
185
186 _add_op(func)

E:\Anconada\lib\site-packages\tf_slim\layers\layers.py in convolution2d(inputs, num_outputs, kernel_size, stride, padding, data_format, rate, activation_fn, normalizer_fn, normalizer_params, weights_initializer, weights_regularizer, biases_initializer, biases_regularizer, reuse, variables_collections, outputs_collections, trainable, scope)
1169 trainable=True,
1170 scope=None):
-> 1171 return convolution(
1172 inputs,
1173 num_outputs,

E:\Anconada\lib\site-packages\tf_slim\ops\arg_scope.py in func_with_args(*args, **kwargs)
182 current_args = current_scope[key_func].copy()
183 current_args.update(kwargs)
--> 184 return func(*args, **current_args)
185
186 _add_op(func)

E:\Anconada\lib\site-packages\tf_slim\layers\layers.py in convolution(inputs, num_outputs, kernel_size, stride, padding, data_format, rate, activation_fn, normalizer_fn, normalizer_params, weights_initializer, weights_regularizer, biases_initializer, biases_regularizer, reuse, variables_collections, outputs_collections, trainable, scope, conv_dims)
1068 df = ('channels_first'
1069 if data_format and data_format.startswith('NC') else 'channels_last')
-> 1070 layer = layer_class(
1071 filters=num_outputs,
1072 kernel_size=kernel_size,

E:\Anconada\lib\site-packages\tensorflow\python\keras\legacy_tf_layers\convolutional.py in init(self, filters, kernel_size, strides, padding, data_format, dilation_rate, activation, use_bias, kernel_initializer, bias_initializer, kernel_regularizer, bias_regularizer, activity_regularizer, kernel_constraint, bias_constraint, trainable, name, **kwargs)
305 name=None,
306 **kwargs):
--> 307 super(Conv2D, self).init(
308 filters=filters,
309 kernel_size=kernel_size,

E:\Anconada\lib\site-packages\tensorflow\python\keras\layers\convolutional.py in init(self, filters, kernel_size, strides, padding, data_format, dilation_rate, groups, activation, use_bias, kernel_initializer, bias_initializer, kernel_regularizer, bias_regularizer, activity_regularizer, kernel_constraint, bias_constraint, **kwargs)
664 kernel_initializer=initializers.get(kernel_initializer),
665 bias_initializer=initializers.get(bias_initializer),
--> 666 kernel_regularizer=regularizers.get(kernel_regularizer),
667 bias_regularizer=regularizers.get(bias_regularizer),
668 activity_regularizer=regularizers.get(activity_regularizer),

E:\Anconada\lib\site-packages\tensorflow\python\keras\regularizers.py in get(identifier)
381 return identifier
382 else:
--> 383 raise ValueError(
384 'Could not interpret regularizer identifier: {}'.format(identifier))

ValueError: Could not interpret regularizer identifier: Tensor("mul_1:0", shape=(), dtype=float32)
这是什么问题导致的,改怎么修改

  • 写回答

2条回答 默认 最新

  • 有问必答小助手 2021-07-07 19:02
    关注

    你好,我是有问必答小助手。为了技术专家团更好地为您解答问题,烦请您补充下(1)问题背景详情,(2)您想解决的具体问题,(3)问题相关代码图片或者报错信息。便于技术专家团更好地理解问题,并给出解决方案。

    您可以点击问题下方的【编辑】,进行补充修改问题。

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 1月4日
  • 已采纳回答 12月27日

悬赏问题

  • ¥15 想用adb命令做一个通话软件,播放录音
  • ¥30 Pytorch深度学习服务器跑不通问题解决?
  • ¥15 部分客户订单定位有误的问题
  • ¥15 如何在maya程序中利用python编写领子和褶裥的模型的方法
  • ¥15 Linux权限管理相关操作(求解答)
  • ¥15 Bug traq 数据包 大概什么价
  • ¥15 在anaconda上pytorch和paddle paddle下载报错
  • ¥25 自动填写QQ腾讯文档收集表
  • ¥15 DbVisualizer Pro 12.0.7 sql commander光标错位 显示位置与实际不符
  • ¥15 android 打包报错