ValueError: ('%s 没有用 @add_arg_scope' 修饰,('__main__', 'bottleneck')) [英] ValueError: ('%s is not decorated with @add_arg_scope', ('__main__', 'bottleneck'))

查看:34
本文介绍了ValueError: ('%s 没有用 @add_arg_scope' 修饰,('__main__', 'bottleneck'))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是代码

 使用 tf.variable_scope(scope, 'resnet_v2', [inputs], repeat=reuse) 作为 sc:end_points_collection = sc.original_name_scope + '_end_points'与 slim.arg_scope([slim.conv2d,bottleneck, stack_blocks_dense],output_collections=[end_points_collection]):

<块引用>

ValueError: ('%s 没有用 @add_arg_scope' 修饰,('ma​​in', 'bottleneck'))d:\resnet\main_resnet.py(219)resnet_v2()->outputs_collections=[end_points_collection])

那么代码有什么问题?

解决方案

原谅我的愚蠢问题,只是在bottleneck的定义之前用@add_arg_scope装饰函数

@add_arg_scope定义瓶颈():

Here is the code

with tf.variable_scope(scope, 'resnet_v2', [inputs], reuse=reuse) as sc:
    end_points_collection = sc.original_name_scope + '_end_points'
    with slim.arg_scope([slim.conv2d, bottleneck, stack_blocks_dense],
                        outputs_collections=[end_points_collection]):

ValueError: ('%s is not decorated with @add_arg_scope', ('main', 'bottleneck')) d:\resnet\main_resnet.py(219)resnet_v2() -> outputs_collections=[end_points_collection])

So what is wrong with the code?

解决方案

forgive my stupid question, just decorates the function with @add_arg_scope before the definition of bottleneck

@add_arg_scope
def bottleneck():

这篇关于ValueError: ('%s 没有用 @add_arg_scope' 修饰,('__main__', 'bottleneck'))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆