【TensorFlow】-- 参数strides、ksize的含义

strides=[1, 1, 1, 1]的含义
在进行卷积、池化操作时会有参数strides。strides即代表在四个维度(batch、 height,、width、channels)所移动的步长

  • strides[0] = 1 在 batch 维度上的移动为 1,也就是不跳过任何一个样本
  • strides[1] = 1 在宽度的方向上步长为1
  • strides[2] = 1 在高度的方向上步长为1
  • strides[3] = 1 在 channels 维度上的移动为 1,也就是不跳过任何一个颜色通道;

ksize==[1, 2, 2, 1]的含义
在进行池化操作时会有参数ksize。ksize即代表在四个维度(batch、 height,、width、channels)池化的尺寸
一般是[1, height, width, 1],因为我们不想在batch和channels上做池化,所以这两个维度设为了1

File "/root/Desktop/EAST-master/multigpu_train.py", line 180, in <module> tf.app.run() File "/root/miniconda3/envs/txy2/lib/python3.7/site-packages/tensorflow_core/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/root/miniconda3/envs/txy2/lib/python3.7/site-packages/absl/app.py", line 312, in run _run_main(main, args) File "/root/miniconda3/envs/txy2/lib/python3.7/site-packages/absl/app.py", line 258, in _run_main sys.exit(main(argv)) File "/root/Desktop/EAST-master/multigpu_train.py", line 110, in main total_loss, model_loss = tower_loss(iis, isms, igms, itms, reuse_variables) File "/root/Desktop/EAST-master/multigpu_train.py", line 30, in tower_loss f_score, f_geometry = model.model(images, is_training=True) File "/root/Desktop/EAST-master/model.py", line 77, in model spp_output = spp_layer(f[0]) File "/root/Desktop/EAST-master/model.py", line 44, in spp_layer strides=[1, strides[0], strides[1], 1], padding='VALID') File "/root/miniconda3/envs/txy2/lib/python3.7/site-packages/tensorflow_core/python/ops/nn_ops.py", line 3815, in max_pool name=name) File "/root/miniconda3/envs/txy2/lib/python3.7/site-packages/tensorflow_core/python/ops/gen_nn_ops.py", line 5662, in max_pool ksize = [_execute.make_int(_i, "ksize") for _i in ksize] File "/root/miniconda3/envs/txy2/lib/python3.7/site-packages/tensorflow_core/python/ops/gen_nn_ops.py", line 5662, in <listcomp> ksize = [_execute.make_int(_i, "ksize") for _i in ksize] File "/root/miniconda3/envs/txy2/lib/python3.7/site-packages/tensorflow_core/python/eager/execute.py", line 169, in make_int (arg_name, repr(v))) TypeError: Expected int for argument 'ksize' not <tf.Tensor 'model_0/feature_fusion/SpatialPyramidPooling/strided_slice_2:0' shape=() dtype=int32>. Process finished with exit code 1
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值